Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find broker id used in the Kafka cluster

Tags:

apache-kafka

I want to know the list of taken broker ids in a kafka cluster. For example, in a cluster with 10 nodes if I create a topic with 10 partitions(or more) I can see from the output of a describe topic command, the brokers to which it has been assigned.

./bin/kafka-topics --describe --zookeeper <zkconnect>:2181 --topic rbtest3

Can I collect this information without creating a topic?

like image 598
Juan John Mathews Avatar asked Nov 28 '22 22:11

Juan John Mathews


1 Answers

You can get list of used broker ids using zookeeper cli.

zookeeper-3.4.8$ ./bin/zkCli.sh -server zookeeper-1:2181 ls /brokers/ids | tail -1
[0]
like image 92
Luciano Afranllie Avatar answered Dec 06 '22 02:12

Luciano Afranllie