在Zookeeper中的角色leader中进入控制台打开命令行即可输入命令/usr/local/zookeeper/bin/zkCli.sh
1:help(显示所有操作命令)
[zk: localhost:2181(CONNECTED) 0] help
ZooKeeper -server host:port cmd args
stat path [watch]
set path data [version]
ls path [watch]
delquota [-n|-b] path
ls2 path [watch]
setAcl path acl
setquota -n|-b val path
history
redo cmdno
printwatches on|off
delete path [version]
sync path
listquota path
rmr path
get path [watch]
create [-s] [-e] path data acl
addauth scheme auth
quit
getAcl path
close
connect host:port
2:ls $path(查看当前ZNode节点中的内容)
[zk: localhost:2181(CONNECTED) 0] ls /
[dubbo, zookeeper]
3:ls2 $path (查看当前ZNode节点的详细信息)
[zk: localhost:2181(CONNECTED) 3] ls2 /
[dubbo, zookeeper]
cZxid