Zookeeper 常用命令

zookeeper Server 启动/关闭/查看状态
zkServer.sh start/stop/stauts

zookeeper Client 启动
zkCli.sh

查看帮助命令
help

查看当前znode中所包含的内容
ls /

查看节点详细数据
ls -s /

创建普通节点不赋值
create /sanguo

创建普通节点并赋值
create /sanguo "yanyi"

创建临时节点
create -e /sanguo/shuguo

创建带序号的节点
create -s /sanguo/weiguo

获得节点的值
get /sanguo

获得节点的详细信息
get -s /sanguo

修改节点数据值
set /sanguo "niubi"

节点的值变化监听
get -w /sanguo

节点的子节点变化监听(路径变化)
ls -w /sanguo

删除所有节点
deleteall /sanguo

删除节点
delete /sanguo/shuguo

查看节点状态
stat /sanguo

posted @ 2020-11-18 20:15  smandar  阅读(205)  评论(0编辑  收藏  举报