1
votes

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.

  1. 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.

  2. 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

1

1 Answers

1
votes

Issue here was version compatibility of zookeeper and java 9 based on today's date(2016-11-13). I reverted back to java 8 and things went fine.

But still open question is why server start gave false message as Starting zookeeper ... STARTED

I figured this issue by looking at zookeeper.out file which said something like

Config file not found: /usr/lib64/jvm/java-1.9.0-openjdk-1.9.0/jre/conf/management/management.properties

Further steps were taken as answer suggested in this question.