zookeeper的python客户端安装

由于服务很多都是python写的,这里需要安装python客户端,所以记录下安装过程


1.由于python客户端依赖c的客户端所以要先安装c版本的客户端

cd zookeeper-3.4.5/src/c
./configure
make 
make install

2.测试c版本客户端

./cli_mt localhost:2181
Watcher SESSION_EVENT state = CONNECTED_STATE
Got a new session id: 0x23f9d77d3fe0001

3.可以执行以下命令进行测试

Here's a list of command supported by the cli shell:

ls <path>             -- list children of a znode identified by <path>. The
                         command set a children watch on the znode.
get <path>            -- get the value of a znode at <path>
set <path> <value>    -- set the value of a znode at <path> to <value>
create [+e|+s] <path> -- create a znode as a child of znode <path>;
                         use +e option to create an ephemeral znode,
                         use +s option to create a znode with a sequence number
                         appended to the name. The operation will fail if
                         the parent znode (the one identified by <path>) doesn't
                         exist.
delete <path>         -- delete the znode at <path>. The command will fail if the znode
                         has children.
sync <path>           -- make sure all pending updates have been applied to znode at <path>
exists <path>         -- returns a result code indicating whether the znode at <path>
                         exists. The command also sets a znode watch.
myid                  -- prints out the current zookeeper session id.
quit                  -- exit the shell.

4.看到以上信息说明c版本的客户端已经安装好了,下面安装python版本客户端

5.下载python扩展包,并且解压:

https://pypi.python.org/pypi/zkpython/0.4.2

6.如果找不到Pyhon.h,可能由于没有安装python26-devel

32位直接运行
yum install python26-devel.i386

7.测试是否成功

import zookeeper


  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值