如何列出集群中所有可用的Kafka经纪人? [英] How to list all available Kafka brokers in a cluster?

查看:44
本文介绍了如何列出集群中所有可用的Kafka经纪人?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个shell脚本来监视kafka经纪人.

I am writing a shell script to monitor kafka brokers.

我浏览了一些链接,发现如果ZooKeeper包含代理列表,并且在此列表中存在IP地址,则说明kafka代理正在运行.

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.

我想要一个可以在我的shell脚本中使用的命令来获取代理列表并检查kafka是否正在运行.

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

是否存在任何 curl 命令来获取kafka集群状态(例如elasticsearch)?

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

推荐答案

此命令将为您提供括号之间的活动代理列表:

This command will give you the list of the active brokers between brackets:

./bin/zookeeper-shell.sh localhost:2181 ls /brokers/ids

这篇关于如何列出集群中所有可用的Kafka经纪人?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆