简体   繁体   中英

Zookeeper/Kafka: No Kafka brokers detected from Zookeeper cluster (Kafka runs fine)

I have created a Kafka cluster with 4 nodes, a Zookeeper cluster with 3 nodes. Kafka is operating at v2.4.0 and Zookeeper at v3.5.6. Kafka cluster successfully starts and could successfully establish a connection with one of the nodes in the Zookeeper cluster (checked kafka logs), to that I can create/list topics, produce/consume messages off of this cluster when I use the --bootstrap-server option. But, upon using the --zookeeper option, things starts failing.

I also tried to list the kafka brokers using zkCli.sh utility that comes along with the standalone zookeeper installation, but, I got an empty list [] .

Command used:

./zkCli.sh -server localhost:2181
ls /brokers/ids

Although, upon using echo stat | nc localhost 2181 echo stat | nc localhost 2181 I can see a list of kafka brokers printed on the console.

I am a bit confused here, as to how my kafka cluster is operational even though queries directed to my zookeeper cluster fail & the fact that I could not list the active kafka brokers using the zkCli utility.

Any insights on this are highly appreciated.

Check the value of Zookeeper chroot path. If it is set, then the following command should be used:

./zkCli.sh -server localhost:2181/zookeeper_chroot_path
ls /brokers/ids

There should be no space between localhost:2181 and zookeeper_chroot_path

This problem arises often because of extra-spaces in the command line when using a zookeeper command-line handler. Just be noteful of the same.

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