关于服务
启动服务
后台运行
bin/zkServer.sh start
前台运行
bin/zkServer.sh start-foreground
重新启动
bin/zkServer.sh restart
查看zk的状态
bin/zkServer.sh status
三种: standalone:单机运行
Folloer: 集群模式下的从服务器
Leander: 集群模式下的主服务器
It is probably not running 没有启动
cluster:集群模式运行 not runnin:没有运行
关闭服务
bin/zkServer.sh stop
关于客户端的命令:
如何进入客户端:
bin/zkCli.sh -server localhost:2181
help
显示所有的命令
ls [path]
显示所有的节点
create [path]
create [path] data
//只能删除没有子节点的节点
delete [path]
//可以删除非空节点
rmr [path]
获取节点:
get /mypath
创建顺序节点
create -s /node/subnodes data