How to list all available Kafka brokers in a clust

2020-02-16 06:43发布

I am writing a shell script to monitor kafka brokers.

I have gone through some links and found that if ZooKeeper contains a list of brokers, and if, in this list, the IP address is present, then a kafka broker is running.

I want a command that I can use in my shell script to get the broker list and check whether kafka is running.

Is there any curl command to get the kafka cluster status like elasticsearch?

7条回答
家丑人穷心不美
2楼-- · 2020-02-16 07:19

To use zookeeper commands with shell script try

zookeeper/bin/zkCli.sh -server localhost:2181 <<< "ls /brokers/ids" | tail -n 1. The last line usually has the response details

查看更多
登录 后发表回答