Install Zookeeper Python Client
If Python is used in the project, you need to use the Zookeeper function. Here, record the installation process.
Kernel version: 2.6.32
Released: CentOS-6.6 64bit
1. Because the python client depends on the c client, you must first install the c client.
[Root @ rocket c] # cd/usr/local/ zookeeper-3.4.6/src/c
[Root @ rocket c] #./configure
[Root @ rocket c] # make
[Root @ rocket c] # make install
2. Test the c Client
The above information indicates that the c client has been installed. The python client is installed below.
3. Download the python extension package and decompress it.
[Root @ rocket local] wget https://pypi.python.org/pypi/zkpython/0.4.2
[Root @ rocket local] # tar-zxvf zkpython-0.4.2.tar.gz
If Python. h cannot be found, it may be because python-devel is not installed.
[Root @ rocket zkpython-0.4.2] # yum-y install python-devel
4. Check whether the test is successful.
[Root @ rocket zookeeper] # cat zk_test.py
Import zookeeper
[Root @ rocket zookeeper] # python zk_test.py
The error message "libzookeeper_mt.so.2" is not found. Add the path libzookeeper_mt.so.2 to LD_LIBRARY_PATH.
[Root @ rocket zookeeper] # python zk_test.py
Traceback (most recent call last ):
File "zk_test.py", line 1, in <module>
Import zookeeper
File "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
Test again
[Root @ rocket zookeeper] # python zk_test.py
If no error is reported, the installation is successful.
-------------------------------------- Split line --------------------------------------
Ubuntu 14.04 installs distributed storage Sheepdog + ZooKeeper
CentOS 6 installs sheepdog VM distributed storage
ZooKeeper cluster configuration
Use ZooKeeper to implement distributed shared locks
Distributed service framework ZooKeeper-manage data in a distributed environment
Build a ZooKeeper Cluster Environment
Test Environment configuration of ZooKeeper server cluster
ZooKeeper cluster Installation
Zookeeper3.4.6 Installation
-------------------------------------- Split line --------------------------------------
This article permanently updates the link address: