Kafka中的zookeeper-shell.sh

连接 zookeeper

bin/zookeeper-shell.sh 127.0.0.1:

常用命令

connect host:port
get path [watch]
ls path [watch]
set path data [version]
rmr path
delquota [-n|-b] path
quit
printwatches on|off
create [-s] [-e] path data acl
stat path [watch]
close
ls2 path [watch]
history
listquota path
setAcl path acl
getAcl path
sync path
redo cmdno
addauth scheme auth
delete path [version]
setquota -n|-b val path

ls [PATH]

ls /
[zookeeper, brokers] #查看broker的id
ls /brokers/ids
[, , ] #查看消息
ls /brokers/topics
[new, __consumer_offsets, test] #查看删除的消息
ls /admin/delete_topics
[account]

get [PATH]

#查看broker的信息
get /brokers/ids/
{"jmx_port":-,"timestamp":"","endpoints":["PLAINTEXT://hs01:9092"],"host":"hs01","version":,"port":}
cZxid = 0x29000048b2
ctime = Wed Jan :: CST
mZxid = 0x29000048b2
mtime = Wed Jan :: CST
pZxid = 0x29000048b2
cversion =
dataVersion =
aclVersion =
ephemeralOwner = 0x261033b8886032a
dataLength =
numChildren =

rmr [PATH]

#删除消息
rmr /brokers/topics/test
rmr /admin/delete_topics/test
上一篇:jQuery 迭代器


下一篇:Leetcode: UniquePath II