zk常用命令行操作
- 通过./zkCli.sh 打开zk的客户端进行命令行后台
- ls 与 ls2(会显示状态信息)
[zk: localhost:2181(CONNECTED) 0] ls /
[zookeeper, test]
[zk: localhost:2181(CONNECTED) 2] get /test
123
cZxid = 0x300000002
ctime = Wed Jan 16 00:19:36 CST 2019
mZxid = 0x300000002
mtime = Wed Jan 16 00:19:36 CST 2019
pZxid = 0x300000002
cversion = 0
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 3
numChildren = 0
cZxid = 0x0 创建id
ctime = Thu Jan 01 08:00:00 CST 1970 创建时间
mZxid = 0x0 修改Id
mtime = Thu Jan 01 08:00:00 CST 1970 修改时间
pZxid = 0x0 子节点id
cversion = -1 子节点版本
dataVersion = 0 当前节点数据版本号,修改后加1
aclVersion = 0 权限
ephemeralOwner = 0x0 判断是持久节点还是临时节点
dataLength = 0 数据长度
numChildren = 1 子节点数