简体   繁体   中英

Kafka shutdown with zookeeper timeout

I am trying to install Kafka setup with 3 Kafka Brokers in single zookeeper node but i am seeing Kafka process getting down in fraction of minutes and throwing error in Kafka logs:

2019-05-29 14:06:42,508] INFO Opening socket connection to server kafka3/192.168.1.103:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn)
[2019-05-29 14:06:44,511] WARN Client session timed out, have not heard from server in 2003ms for sessionid 0x0 (org.apache.zookeeper.ClientCnxn)
[2019-05-29 14:06:44,511] INFO Client session timed out, have not heard from server in 2003ms for sessionid 0x0, closing socket connection and attempting reconnect (org.apache.zookeeper.ClientCnxn)
[2019-05-29 14:06:45,613] INFO Opening socket connection to server kafka2/192.168.1.102:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn)
[2019-05-29 14:06:47,617] WARN Client session timed out, have not heard from server in 3004ms for sessionid 0x0 (org.apache.zookeeper.ClientCnxn)
[2019-05-29 14:06:47,617] INFO Client session timed out, have not heard from server in 3004ms for sessionid 0x0, closing socket connection and attempting reconnect (org.apache.zookeeper.ClientCnxn)
[2019-05-29 14:06:47,718] INFO Opening socket connection to server kafka1/192.168.1.101:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn)
[2019-05-29 14:06:48,988] INFO [ZooKeeperClient] Closing. (kafka.zookeeper.ZooKeeperClient)
[2019-05-29 14:06:49,720] WARN Client session timed out, have not heard from server in 2002ms for sessionid 0x0 (org.apache.zookeeper.ClientCnxn)
[2019-05-29 14:06:49,825] INFO Session: 0x0 closed (org.apache.zookeeper.ZooKeeper)
[2019-05-29 14:06:49,827] INFO [ZooKeeperClient] Closed. (kafka.zookeeper.ZooKeeperClient)
[2019-05-29 14:06:49,830] ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
kafka.zookeeper.ZooKeeperClientTimeoutException: Timed out waiting for connection while in state: CONNECTING
        at kafka.zookeeper.ZooKeeperClient$$anonfun$kafka$zookeeper$ZooKeeperClient$$waitUntilConnected$1.apply$mcV$sp(ZooKeeperClient.scala:268)
        at kafka.zookeeper.ZooKeeperClient$$anonfun$kafka$zookeeper$ZooKeeperClient$$waitUntilConnected$1.apply(ZooKeeperClient.scala:264)
        at kafka.zookeeper.ZooKeeperClient$$anonfun$kafka$zookeeper$ZooKeeperClient$$waitUntilConnected$1.apply(ZooKeeperClient.scala:264)
        at kafka.utils.CoreUtils$.inLock(CoreUtils.scala:251)
        at kafka.zookeeper.ZooKeeperClient.kafka$zookeeper$ZooKeeperClient$$waitUntilConnected(ZooKeeperClient.scala:264)
        at kafka.zookeeper.ZooKeeperClient.<init>(ZooKeeperClient.scala:97)
        at kafka.zk.KafkaZkClient$.apply(KafkaZkClient.scala:1693)
        at kafka.server.KafkaServer.kafka$server$KafkaServer$$createZkClient$1(KafkaServer.scala:348)
        at kafka.server.KafkaServer.initZkClient(KafkaServer.scala:372)
        at kafka.server.KafkaServer.startup(KafkaServer.scala:202)
        at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:38)
        at kafka.Kafka$.main(Kafka.scala:75)
        at kafka.Kafka.main(Kafka.scala)
[2019-05-29 14:06:49,833] INFO shutting down (kafka.server.KafkaServer)
[2019-05-29 14:06:49,836] INFO shut down completed (kafka.server.KafkaServer)
[2019-05-29 14:06:49,837] ERROR Exiting Kafka. (kafka.server.KafkaServerStartable)
[2019-05-29 14:06:49,841] INFO EventThread shut down for session: 0x0 (org.apache.zookeeper.ClientCnxn)
[2019-05-29 14:06:49,843] INFO shutting down (kafka.server.KafkaServer)

Did you start Zookeeper on that port? It seems like the Kafka server can't connect to the zookeeper. If you are using linux, you may check the net status of the port using netstat -anlp | grep 2181 netstat -anlp | grep 2181

[Windows instruction]

Go to

C:\\Windows\\System32\\drivers\\etc

And add this lines:

0.0.0.0        localhost
192.168.1.103  localhost

And save file

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM