I am trying to setup Zookeeper with single server ensemble on my Ubuntu machine. I started server with success message and was expecting it as started.
akshay@akshay:~$ /var/zookeeper/zookeeper-3.4.9/bin/zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /var/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
akshay@akshay:~$
But it seems server was never started though logs says started. I also tried starting server without start option as suggested in similar questions which was again not a success.
I verified this with below ways.
Server Status
akshay@akshay:~$ /var/zookeeper/zookeeper-3.4.9/bin/zkServer.sh status ZooKeeper JMX enabled by default Using config: /var/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg Error contacting service. It is probably not running.
Tried kazoo client to connect to server and end up with timeout error.
from kazoo.client import KazooClient zk_client = KazooClient(hosts='127:0:0:1:2181') zk_client.start()
Output:
--------------------------------------------------------------------------- KazooTimeoutError Traceback (most recent call last) in () ----> 1 zk_client.start()
/usr/local/lib/python2.7/dist-packages/kazoo/client.pyc in start(self, timeout) 544 # We time-out, ensure we are disconnected 545 self.stop() --> 546 raise self.handler.timeout_exception("Connection time-out") 547 548 if self.chroot and not self.exists("/"):
KazooTimeoutError: Connection time-out
Below is my zoo.cfg
akshay@akshay:~$ cat /var/zookeeper/zookeeper-3.4.9/conf/zoo.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/var/zookeeper/data
clientPort=2181
Can someone please help if I am missing anything during the process. I followed setup steps from apache zookeeper doc