Install Zookeeper Python Client

Source: Internet
Author: User

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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.