zookeeper 的急速入门( zookeeper basic operations )

访问量: 1608

算是我的学习笔记吧。 记录如下: ( 原文见: http://zookeeper.apache.org/doc/trunk/zookeeperStarted.html#sc_InstallingSingleMode  ) 

1. 安装并运行: download the file, unzip it.  then $ bin/zkServer.sh start

2. 使用JAVA客户端连接zookeeper 服务器: 

$ bin/zkCli.sh -server 127.0.0.1:2181

3. 基本操作来了:  

$ ls /
[zookeeper]
$ ls /zookeeper
[quota]
$ create /siwei my_data
Created /siwei

$ get /siwei
my_data
cZxid = 0x19
ctime = Wed Mar 13 09:13:43 CST 2013
mZxid = 0x19
.......   

$ set /siwei junk
cZxid = 0x19
ctime = Wed Mar 13 09:13:43 CST 2013
mZxid = 0x1a
.....

$ get /siwei
junk
cZxid = 0x19
ctime = Wed Mar 13 09:13:43 CST 2013

$ delete /siwei
$ ls /
[zookeeper]



订阅/RSS Feed

Subscribe

分类/category