kafka-topic.sh 查询topic详细信息时,查询结果没有数据或者报错
Error while executing topic command : Topic mobilePhone does not exist on ZK path master:2181,slave1:2181,slave3:2181
造成这个错误的原因也是 在执行命令时,忘记输入配置zookeeper时的根目录hostname:port/kafak,直接写成了主机名加端口号,从而zookeeper找不到topic的路径。
-bash-4.2$ bin/kafka-topics.sh --topic topic_test1 --zookeeper 192.168.15.11:2181,192.168.15.12:2181,192.168.15.13:2181 --describe
-bash-4.2$ bin/kafka-topics.sh --topic topic_test1 --zookeeper 192.168.15.11:2181,192.168.15.12:2181,192.168.15.13:2181/testkafka --describe
Topic:topic_spark PartitionCount:3 ReplicationFactor:3 Configs:retention.bytes=96636764160
Topic: topic_spark Partition: 0 Leader: 0 Replicas: 0,2,1 Isr: 2,1,0
Topic: topic_spark Partition: 1 Leader: 1 Replicas: 1,0,2 Isr: 2,1,0
Topic: topic_spark Partition: 2 Leader: 2 Replicas: 2,1,0 Isr: 2,1,0