通过shell连接ckServer
Once ZooKeeper is running, you have several options for connection to it: Java: Use
bin/zkCli.sh -server 127.0.0.1:2181
Once you have connected, you should see something like:
Connecting to localhost:2181
log4j:WARN No appenders could be found for logger (org.apache.zookeeper.ZooKeeper).
log4j:WARN Please initialize the log4j system properly.
Welcome to ZooKeeper!
JLine support is enabled
[zkshell: 0]
From the shell, type help to get a listing of commands that can be executed from the client, as in:
[zkshell: 0] help
ZooKeeper host:port cmd args
get path [watch]
ls path [watch]
set path data [version]
delquota [-n|-b] path
quit
printwatches on|off
createpath data acl
stat path [watch]
listquota path
history
setAcl path acl
getAcl path
sync path
redo cmdno
addauth scheme auth
delete path [version]
setquota -n|-b val path
From here, you can try a few simple commands to get a feel for this simple command line interface. First, start by issuing the list command, as in ls, yielding:
./configure --prefix=/home/yunpeng.jiangyp/sys/zk_client
make
make install
# 然后下载zkpython
wget http://pypi.python.org/packages/source/z/zkpython/zkpython-0.4.tar.gz#md5=3de220615aaddf57f1462b78d32477f9
tar xzvf zkpython-0.4.tar.gz
cd zkpython-0.4
python setup.py install
或者
pip install zkpython
参考:http://blog.csdn.net/lengzijian/article/details/9227005
运行cli_mt报错
ImportError: libzookeeper_mt.so.2: cannot open shared object file: No such file or directory