Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8225779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:31:50+00:00 2026-06-07T15:31:50+00:00

I am trying to get zookeeper to work in standalone mode for python api

  • 0

I am trying to get zookeeper to work in standalone mode for python api testing and am having issues with the python api.

1) Here is how I installed on ubuntu 11.04

sudo apt-get install zookeeper
sudo easy_install zc-zookeeper-static
from source install python zc.zk
http://pypi.python.org/packages/source/z/zc.zk/zc.zk-0.9.1.tar.gz

2) Here is how I start zookeeper:

sudo /usr/share/zookeeper/bin/zkCli.sh -server 127.0.0.1:2181
Connecting to 127.0.0.1:2181
Welcome to ZooKeeper!
JLine support is enabled
[zk: 127.0.0.1:2181(CONNECTING) 0] 

3) Here is how I try and using the python api per the docs.

import zc.zk
zk = zc.zk.ZooKeeper('localhost:2181')
zk.register_server('/fooservice/providers', ('192.168.0.42', 8080))

4) Here is the python error I get.

No handlers could be found for logger "ZooKeeper"
Traceback (most recent call last):
  File "/home/ubuntu/workspace/rtbopsConfig/zookeeper/test.py", line 2, in <module>
    zk = zc.zk.ZooKeeper('localhost:2181')
  File "/usr/local/lib/python2.7/dist-packages/zc.zk-0.9.1-py2.7.egg/zc/zk/__init__.py", line 211, in __init__
    raise FailedConnect(connection_string)
zc.zk.FailedConnect: localhost:2181

5) Here is the log file:

2012-07-15 14:23:51,666 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1000] - Opening socket connection to server localhost/127.0.0.1:2181
2012-07-15 14:23:51,667 - WARN  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1120] - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:592)
        at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1078)
2012-07-15 14:23:53,076 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1000] - Opening socket connection to server localhost/127.0.0.1:2181
2012-07-15 14:23:53,077 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@908] - Socket connection established to localhost/127.0.0.1:2181, initiating session
2012-07-15 14:23:53,165 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1114] - Unable to reconnect to ZooKeeper service, session 0x0 has expired, closing socket connection

So…I am new to zookeeper. I would like to get up and running in standalone mode with the python api. Alos, there seems top be a lot of python zookeeper api’s. Which one is the most used?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T15:31:54+00:00Added an answer on June 7, 2026 at 3:31 pm

    Are you using IPv6 on your ubuntu? Replace localhost to 127.0.0.1, the same as used in zkCli.sh command. You can run sudo netstat -lnp|grep 2181 to check the address which the zookeeper listen on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying get Struts 2 and Tiles to work and I am using
Trying to get this expression to work, can someone look at it and tell
Hello everyone I been trying get php uploader working but having a lot of
I've been at this for 12+ exhausting hours trying get it to work on
Trying to get into PostgreSQL. I'm drawing an function that will check credentials Here
I'm trying get LocalConnection to work between two swf's placed within two different IFRAMES.
I am trying get Javascript popup calendar control to work which doesnt work. I
i am very new to regular expression and trying get \ character using python
I've this code that uses Savon that I'm trying get to work. require savon
So i am trying get 2 div-containers which both should contain centered text (Both

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.