zookeeper的python用戶端安裝

來源:互聯網
上載者:User

由於服務很多都是python寫的,這裡需要安裝python用戶端,所以記錄下安裝過程

1.由於python用戶端依賴c的用戶端所以要先安裝c版本的用戶端

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

2.測試c版本用戶端

./cli_mt localhost:2181Watcher SESSION_EVENT state = CONNECTED_STATEGot 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
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.