问题描述
我想知道是否有办法使用 shell 命令检索 kafka 代理的所有配置属性?
I was wondering if there is a way to retrieve all the configuration properties of a kafka broker using a shell command?
例如,类似于:
./kafka-configs.sh --zookeeper ${broker_ip}:2181 --entity-type brokers --describe
上面没有返回任何值,但我希望这个问题在查看命令时更清楚
The above doesn't return any value, but I hope the question is clearer looking at the command
推荐答案
您可以在 Kafka broker 启动时打印的日志文件中找到该配置.恐怕有这样的命令列出了 Kafka broker 的所有配置参数.
You can find the configuration in the log file of Kafka broker which is printed on broker start up. I am afraid that there is such command that lists all the configuration parameters of a Kafka broker.
可以通过 Zookeeper 检索有关 Kafka 代理的更多信息(但是这些命令不会为您提供 kafka 配置).为此,
Some more information regarding Kafka brokers can be retrieved through Zookeeper (however these commands won't give you the kafka configuration). To do so,
进入Zookeeper shell:
Enter Zookeeper shell:
zookeeper-shell localhost:2181
然后运行
get /brokers/ids/0
为具有 id 0
的经纪人检索更多信息.
to retrieve some further information for broker with id 0
.
虽然kafka-configs
声称能够描述kafka配置,命令
Although kafka-configs
claims to be able to describe kafka configuration, command
kafka-configs --bootstrap-server localhost:9092 --describe --entity-type brokers --entity-name 0
Configs for broker 0 are:
似乎没有返回任何配置参数.
doesn't seem to return any configuration parameters.
这篇关于从客户端检索 Kafka 代理属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!