zookeeper简单操作命令
下面的是zookeeper的一些操作命令
帮助命令:help
[zk: 127.0.0.1:2181(CONNECTED) 2] help ZooKeeper -server host:port cmd args 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 [zk: 127.0.0.1:2181(CONNECTED) 3]
列表命令:ls
[zk: 127.0.0.1:2181(CONNECTED) 3] ls / [zookeeper] [zk: 127.0.0.1:2181(CONNECTED) 4]
创建新节点命令:create
[zk: 127.0.0.1:2181(CONNECTED) 4] create /test mydata Created /test [zk: 127.0.0.1:2181(CONNECTED) 5] ls / [test, zookeeper] [zk: 127.0.0.1:2181(CONNECTED) 6]
获取节点get
[zk: 127.0.0.1:2181(CONNECTED) 6] get /test mydata cZxid = 0x12 ctime = Tue May 13 08:30:22 PDT 2014 mZxid = 0x12 mtime = Tue May 13 08:30:22 PDT 2014 pZxid = 0x12 cversion = 0 dataVersion = 0 aclVersion = 0 ephemeralOwner = 0x0 dataLength = 6 numChildren = 0 [zk: 127.0.0.1:2181(CONNECTED) 7]
修改set
[zk: 127.0.0.1:2181(CONNECTED) 7] set /test yunix_test cZxid = 0x12 ctime = Tue May 13 08:30:22 PDT 2014 mZxid = 0x13 mtime = Tue May 13 08:33:45 PDT 2014 pZxid = 0x12 cversion = 0 dataVersion = 1 aclVersion = 0 ephemeralOwner = 0x0 dataLength = 10 numChildren = 0 [zk: 127.0.0.1:2181(CONNECTED) 8] get /test yunix_test cZxid = 0x12 ctime = Tue May 13 08:30:22 PDT 2014 mZxid = 0x13 mtime = Tue May 13 08:33:45 PDT 2014 pZxid = 0x12 cversion = 0 dataVersion = 1 aclVersion = 0 ephemeralOwner = 0x0 dataLength = 10 numChildren = 0 [zk: 127.0.0.1:2181(CONNECTED) 9]
删除命令:delete
[zk: 127.0.0.1:2181(CONNECTED) 9] delete /test [zk: 127.0.0.1:2181(CONNECTED) 10] ls / [zookeeper] [zk: 127.0.0.1:2181(CONNECTED) 11]
相关推荐
潘威威 2014-05-13
CobingLiu 2019-10-25
hudyang 2017-04-07
加号Jaryn笔录 2017-04-07
ZooKeeper 2016-06-17
ZooKeeper支持某些特定的四字命令字母与其的交互。它们大多是查询命令,用来获取ZooKeeper服务的当前状态及相关信息。用户在客户端可以通过telnet或nc向ZooKeeper提交相应的命令
ZooKeeper 2015-10-23
Stereo 2012-08-05
deyu 2020-07-07
枫叶上的雨露 2020-04-30
Java高知 2020-04-22
Fightingxr 2020-02-12
adayan0 2020-01-31
CobingLiu 2020-01-10
大牧关东 2014-06-18
CobingLiu 2019-11-05
KingfuL 2019-10-27
Stereo 2019-05-06
Jolestar 2018-12-25
fxinzi 2019-08-01