首页 / 操作系统 / Linux / Zookeeper的Python客户端安装
项目中使用了Python,需要使用到Zookeeper的功能,这里记录一下安装过程。内核版本:2.6.32发行版:CentOS-6.6 64bit1、由于python客户端依赖c的客户端所以要先安装c版本的客户端[root@rocket c]# cd /usr/local/zookeeper-3.4.6/src/c[root@rocket c]# ./configure[root@rocket c]# make[root@rocket c]# make install2、测试c客户端看到以上信息说明c版本的客户端已经安装好了,下面安装python版本客户端3、下载python扩展包,并且解压[root@rocket local]wget https://pypi.python.org/pypi/zkpython/0.4.2[root@rocket local]# tar -zxvf zkpython-0.4.2.tar.gz如果找不到Python.h,可能由于没有安装python-devel[root@rocket zkpython-0.4.2]# yum -y install python-devel4、测试是否成功[root@rocket zookeeper]# cat zk_test.pyimport zookeeper[root@rocket zookeeper]# python zk_test.py提示找不到libzookeeper_mt.so.2,将libzookeeper_mt.so.2的路径加入到LD_LIBRARY_PATH中[root@rocket zookeeper]# python zk_test.pyTraceback (most recent call last):File "zk_test.py", line 1, in <module>import zookeeperFile "build/bdist.linux-x86_64/egg/zookeeper.py", line 7, in <module>File "build/bdist.linux-x86_64/egg/zookeeper.py", line 6, in __bootstrap__ImportError: libzookeeper_mt.so.2: cannot open shared object file: No such file or directory[root@rocket zookeeper]# export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH再次测试[root@rocket zookeeper]# python zk_test.py没报错,说明已经成功安装。--------------------------------------分割线 --------------------------------------Ubuntu 14.04安装分布式存储Sheepdog+ZooKeeper http://www.linuxidc.com/Linux/2014-12/110352.htmCentOS 6安装sheepdog 虚拟机分布式储存 http://www.linuxidc.com/Linux/2013-08/89109.htmZooKeeper集群配置 http://www.linuxidc.com/Linux/2013-06/86348.htm使用ZooKeeper实现分布式共享锁 http://www.linuxidc.com/Linux/2013-06/85550.htm分布式服务框架 ZooKeeper -- 管理分布式环境中的数据 http://www.linuxidc.com/Linux/2013-06/85549.htmZooKeeper集群环境搭建实践 http://www.linuxidc.com/Linux/2013-04/83562.htmZooKeeper服务器集群环境配置实测 http://www.linuxidc.com/Linux/2013-04/83559.htmZooKeeper集群安装 http://www.linuxidc.com/Linux/2012-10/72906.htmZookeeper3.4.6的安装 http://www.linuxidc.com/Linux/2015-05/117697.htm--------------------------------------分割线 --------------------------------------本文永久更新链接地址