Reputation: 396
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
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.
Upvotes: 1
Views: 1227
Reputation: 17
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.
Upvotes: 0
Reputation: 136
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
Upvotes: 3