维护

查看集群状态
[root@service3 bin]# ./zkServer.sh status
/usr/bin/java
ZooKeeper JMX enabled by default
Using config: /ops/server/zookeeperc/zookeeper-3.5.2-alpha/bin/../conf/zoo.cfg
Client port found: 2182. Client address: localhost.
Mode: leader

查看节点是否正常
echo ruok|nc 127.0.0.1 2181

进入zookeeper命令行
./bin/zkCli.sh -server 192.168.255.133:2181

列出zookeeper内容
zk ls /

创建新的znode
create /zk “myData”

获取znode字符串
get /zk

设置字符串
set /zk “zsl”

删除znode
delete /zk

 

posted @ 2019-01-04 15:09  禾子、  阅读(174)  评论(0编辑  收藏  举报