1. 登录 zookeeper shell
$? ?/path/to/bin/zookeeper-shell.sh 172.16.218.25:2189?
对? zookeeper的操作可以非交互式直接操作,也可以登录zookeeper shell 操作。
2.?ls [PATH]
# 查看根
$? /path/to/bin/zookeeper-shell.sh 172.16.218.25:2189???ls? /
[zookeeper, brokers]
#查看broker的id
> ls? /brokers/ids
[3,2,0]
#查看消息
> ls? /brokers/topics
[new, __consumer_offsets, test]
#查看删除的消息
> ls? /admin/delete_topics
[account]
# 查看kafka的controller
$ sh zookeeper-shell.sh 172.16.218.25:2189 get? ?/controller
3. get [PATH]
#查看broker的信息
>? get? ?/brokers/ids/0
4.?rmr [PATH]
#删除消息
> rmr? /brokers/topics/test
> rmr /admin/delete_topics/test
参考?
Kafka中的zookeeper-shell.sh
https://www.cnblogs.com/yako/p/9660704.html