简体   繁体   English

Kafka集群配置检查

[英]Kafka cluster configuration check

Kafka comes with various .sh script to perform management activities on Kafka cluster such as topic creation, partition etc. But I am after .sh script which would allow me to inspect (discover) the active (in-force) configuration of building blocks such as broker, topic, partitions etc. Kafka附带了各种.sh script来在Kafka集群上执行管理活动,例如主题创建、分区等。但我正在使用.sh script ,它允许我检查(发现)构建块的活动(有效)配置,例如作为代理,主题,分区等。

Is there any .sh script that is available which does this configuration inspection at runtime?是否有任何可用的.sh script在运行时进行此配置检查?

Note: I would like to view all configuration key/value entries (including default and overridden if any) for broker/topic/partition together or ideally separate.注意:我想一起查看代理/主题/分区的所有配置键/值条目(包括默认值和覆盖的,如果有的话),或者理想情况下是分开的。

Thanks in advance.提前致谢。

You can use topics.sh and describe the topic to get config detail related to the topic , the number of partition , replication factor , in sync replicas .您可以使用topics.sh并描述主题来获取与topicthe number of partitionreplication factorin sync replicas相关的配置详细信息。 Try尝试

$ bin/kafka-topics.sh --describe --bootstrap-server localhost:9092 --topic my-topic

You will get something like:你会得到类似的东西:

Topic:my-topic   PartitionCount:1    ReplicationFactor:3 Configs:
    Topic: my-topic  Partition: 0    Leader: 1   Replicas: 1,2,0 Isr: 1,2,0

If I understand your question correctly then you are probably after something like the following如果我正确理解了您的问题,那么您可能会遇到以下问题

kafka-configs.sh $ZK --describe --entity-type topics This will provide the config for all topics. kafka-configs.sh $ZK --describe --entity-type topics这将为所有主题提供配置。 If no values exist for a topic then it means they are using the defaults (usually in server.properties ).如果某个主题不存在任何值,则意味着它们正在使用默认值(通常在server.properties中)。

Instead of topics you can also use brokers , clients and users .除了topics ,您还可以使用brokersclientsusers

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM