从客户端检索Kafka经纪人属性

从客户端检索Kafka经纪人属性

本文介绍了从客户端检索Kafka经纪人属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有一种方法可以使用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代理日志文件中找到配置.恐怕有这样的命令列出了Kafka代理的所有配置参数.

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经纪人属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 01:47