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: <
Using Confluent's REST Proxy API:
curl -X GET -H "Accept: application/vnd.kafka.v2+json" localhost:8082/topics
where localhost:8082
is Kafka Proxy address.
You need to start the zookeeper server first. So first go to kafka/bin/windows and run
zookeeper-server-start.bat ../../config/zookeeper.properties
then in the same folder with a new cmd windows start the kafka servers by running
kafka-server-start.bat ../../config/server.properties
Note: if you starting it for the first time then there are certain changes to be made in these files
then inside kafka/bin/windows run
kafka-topics.bat --zookeeper localhost:2181 --list
to list down all the topics existing.
The Kafka clients no longer require zookeeper but the Kafka servers do need it to operate.
You can get a list of topics with the new AdminClient API but the shell command that ship with Kafka have not yet been rewritten to use this new API.
The other way to use Kafka without Zookeeper is to use a SaaS Kafka-as-a-Service provider such as Confluent Cloud so you don’t see or operate the Kafka brokers (and the required backend Zookeeper ensemble).
For example on Confluent Cloud you would just use the following zookeeper free CLI command:
ccloud topic list
Please use kafka-topics.sh --list --bootstrap-server localhost:9092
to list down all topics
to see that topic if we run the list topic command:
$ bin/kafka-topics.sh --list --zookeeper localhost:2181
To check if the data is landing in Kafka:
$ bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic twitterstream --from-beginning
You have a stale version of the package with commands that no longer accept zookeeper but rather bootstrap-server as the connection. Confluent will then connect with Zookeeper internally.
https://www.confluent.io/download/ (5.3 or greater)