I'm using kafka 0.10 without zookeeper. I want to get kafka topics list. This command is not working since we're not using zookeeper: bin/kafka-topics.sh --list --zookeeper localhost:2181
. How can I get the same output without zookeeper?
Kafka uses ZooKeeper so you need to first start a ZooKeeper server if you don't already have one.
If you do not want to install and have a separate zookeeper server, you can use the convenience script packaged with kafka to get a quick-and-dirty single-node ZooKeeper instance.
Starting the single-node Zookeeper instance:
bin/zookeeper-server-start.sh config/zookeeper.properties
Starting the Kafka Server:
bin/kafka-server-start.sh config/server.properties
Listing the Topics available in Kafka:
bin/kafka-topics.sh --list --zookeeper localhost:2181
Kafka 2.2 and up
Newer versions of Kafka no longer requires ZooKeeper connection string to list topics, but can directly go via the Kafka brokers. kafka-topics.sh
is provided in the bin/
folder when downloading Kafka. To list topics, do the following:
bin/kafka-topics.sh --list --bootstrap-server <BROKER-LIST>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With