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: <
Kafka is a distributed system and needs Zookeeper. you have to start zookeeper too. Follow "Quick Start" here : https://kafka.apache.org/0100/documentation.html#quickstart
You can try using the below two command and list all Kafka topic
Commands:
To start the kafka:
$ nohup ~/kafka/bin/kafka-server-start.sh ~/kafka/config/server.properties > ~/kafka/kafka.log 2>&1 &
To list out all the topic on on kafka;
$ bin/kafka-topics.sh --list --zookeeper localhost:2181
To check the data is landing on kafka topic and to print it out;
$ bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic your_topic_name --from-beginning
To read messages you should use:
kafka-console-consumer.sh --bootstrap-server kafka1:9092,kafka2:9092,kafka3:9092 --topic messages --from-beginning
--bootstrap-server
is required attribute.
You can use only single kafka1:9020
node.
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
For dockerized kafka/zookeeper
docker ps
find you zookeeper container id
docker exec -it <id> bash
cd bin
./zkCli.sh
ls /brokers/topics