org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server within timeout: 30000

tip

Stop all kafka and zookeper proccesses ("ps -aux | grep zoo" and "ps -aux | grep kafka" and kill all the proccess ids) then, run zookeper and then run kafka server.

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • GitHub comment 3032#222712349
    via GitHub by drcrallen
    ,
  • GitHub comment 3039#279546548
    via GitHub by gianm
    ,
  • GitHub comment 2715#203506052
    via GitHub by gianm
    ,
  • GitHub comment 2807#209703822
    via GitHub by binlijin
    ,
  • clean shutdown after zookeeper connection failure
    via by Unknown author,
  • clean shutdown after zookeeper connection failure
    via by Jason Rosenberg,
  • I have noticed this when running CDAP against MapR, but seems like it could happen in any cluster with secure zookeeper. When CDAP starts up a container, it can intermittently fail with the exception below. The same container being launched on the same node will intermittently exhibit this behavior. It seems related to the kafka client connecting to a SASL-enabled zookeeper, which is the default in MapR distributions. {code} 18:01:25.714 [EmbeddedKafkaServer STARTING] WARN o.a.t.i.kafka.EmbeddedKafkaServer - Timeout when connecting to ZooKeeper from KafkaServer. Attempt number 0. org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server within timeout: 3000 at org.I0Itec.zkclient.ZkClient.connect(ZkClient.java:880) ~[com.101tec.zkclient-0.3.jar:0.3] at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:98) ~[com.101tec.zkclient-0.3.jar:0.3] at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:84) ~[com.101tec.zkclient-0.3.jar:0.3] at kafka.common.KafkaZookeeperClient$.getZookeeperClient(Unknown Source) ~[org.apache.kafka.kafka_2.10-0.8.0.jar:0.8.0] at kafka.server.KafkaZooKeeper.startup(Unknown Source) ~[org.apache.kafka.kafka_2.10-0.8.0.jar:0.8.0] at kafka.server.KafkaServer.startup(Unknown Source) ~[org.apache.kafka.kafka_2.10-0.8.0.jar:0.8.0] at org.apache.twill.internal.kafka.EmbeddedKafkaServer.startUp(EmbeddedKafkaServer.java:58) ~[org.apache.twill.twill-core-0.6.0-incubating.jar:0.6.0-incubating] at com.google.common.util.concurrent.AbstractIdleService$1$1.run(AbstractIdleService.java:43) [com.google.guava.guava-13.0.1.jar:na] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60] {code}
    via by Derek Wood,
    • org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server within timeout: 30000 at org.I0Itec.zkclient.ZkClient.connect(ZkClient.java:1223) at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:155) at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:129) at kafka.utils.ZkUtils$.createZkClientAndConnection(ZkUtils.scala:89) at kafka.utils.ZkUtils$.apply(ZkUtils.scala:71) at kafka.server.KafkaServer.initZk(KafkaServer.scala:278) at kafka.server.KafkaServer.startup(KafkaServer.scala:168) at io.druid.indexing.kafka.test.TestBroker.start(TestBroker.java:73) at io.druid.indexing.kafka.KafkaIndexTaskTest.setUp(KafkaIndexTaskTest.java:248)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Raggyman
    Raggyman124 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    18 more bugmates