-1

I'm reiterating the question here - "kafka.zookeeper.ZooKeeperClientTimeoutException: Timed out waiting for connection" ONLY DURING LISTING TOPICS.

C:\Softwares\Elastic_Kafka\kafka\bin\windows>kafka-topics.bat --zookeeper localhost:9092 --alter --topic quickstart-events --partitions 5
[2021-03-03 19:52:20,897] WARN Client session timed out, have not heard from server in 30001ms for sessionid 0x0 (org.apache.zookeeper.ClientCnxn)
Exception in thread "main" kafka.zookeeper.ZooKeeperClientTimeoutException: Timed out waiting for connection while in state: CONNECTING
        at kafka.zookeeper.ZooKeeperClient.$anonfun$waitUntilConnected$3(ZooKeeperClient.scala:262)
        at kafka.zookeeper.ZooKeeperClient.waitUntilConnected(ZooKeeperClient.scala:258)
        at kafka.zookeeper.ZooKeeperClient.<init>(ZooKeeperClient.scala:119)
        at kafka.zk.KafkaZkClient$.apply(KafkaZkClient.scala:1865)
        at kafka.admin.TopicCommand$ZookeeperTopicService$.apply(TopicCommand.scala:360)
        at kafka.admin.TopicCommand$.main(TopicCommand.scala:55)
        at kafka.admin.TopicCommand.main(TopicCommand.scala)

Here is my error:

C:\Softwares\Elastic_Kafka\kafka\bin\windows>kafka-topics.bat --create --topic quickstart-events --bootstrap-server localhost:9092
Created topic quickstart-events.

C:\Softwares\Elastic_Kafka\kafka\bin\windows>kafka-topics.bat --zookeeper localhost:9092 --alter --topic quickstart-events --partitions 5
[2021-03-03 19:52:20,897] WARN Client session timed out, have not heard from server in 30001ms for sessionid 0x0 (org.apache.zookeeper.ClientCnxn)
Exception in thread "main" kafka.zookeeper.ZooKeeperClientTimeoutException: Timed out waiting for connection while in state: CONNECTING
        at kafka.zookeeper.ZooKeeperClient.$anonfun$waitUntilConnected$3(ZooKeeperClient.scala:262)
        at kafka.zookeeper.ZooKeeperClient.waitUntilConnected(ZooKeeperClient.scala:258)
        at kafka.zookeeper.ZooKeeperClient.<init>(ZooKeeperClient.scala:119)
        at kafka.zk.KafkaZkClient$.apply(KafkaZkClient.scala:1865)
        at kafka.admin.TopicCommand$ZookeeperTopicService$.apply(TopicCommand.scala:360)
        at kafka.admin.TopicCommand$.main(TopicCommand.scala:55)
        at kafka.admin.TopicCommand.main(TopicCommand.scala)

C:\Softwares\Elastic_Kafka\kafka\bin\windows>
halfer
  • 19,824
  • 17
  • 99
  • 186
PAA
  • 1
  • 46
  • 174
  • 282
  • 2
    We don't permit duplicate questions here - this is a self-admitted duplicate of ["kafka.zookeeper.ZooKeeperClientTimeoutException: Timed out waiting for connection" ONLY DURING LISTING TOPICS](https://stackoverflow.com/questions/59868898/kafka-zookeeper-zookeeperclienttimeoutexception-timed-out-waiting-for-connecti). – halfer Mar 28 '21 at 10:54
  • Please do not reflexively add "any quick help?" to your questions. Begging for preferential treatment is discouraged. – halfer Mar 28 '21 at 10:56

1 Answers1

0

You're connecting to the wrong port, or misusing the parameters, Zookeeper is not running on port 9092, and you should be using --bootstrap-server rather than --zookeeper

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245