Kafka学习之Replication tools之List Topic Tool

原文链接:https://cwiki.apache.org/confluence/display/KAFKA/Replication+tools#Replicationtools-3.ListTopicTool

此工具能干啥?

此工具列出了一个指定的topic的列表的信息。如果在命令行中没有提供topic,则会向ZK查询,获得所有的topic并展示它们的信息,其中有topic的名字,partition,leader,replicas,isr。有2个可选的参数。如果设置了under-replicated-partitions参数,则只会展示正在replicate中的topic/partition。如果设置了unavailable-partitions参数,则只会展示leader不可用的topic/partitons。

如何使用?

List info for topic1
bin/kafka-list-topic.sh --zookeeper localhost:2121 --topic topic1
 
List info for all topics
bin/kafka-list-topic.sh --zookeeper localhost:2121
 
List info for topics which have under replicated count
bin/kafka-list-topic.sh --zookeeper localhost:2121 --under-replicated-partitions
 
List info for topics whose leader for a partition is not available
bin/kafka-list-topic.sh --zookeeper localhost:2121 --unavailable-partitions

猜你喜欢

转载自damacheng009.iteye.com/blog/2088364