Support Questions
Find answers, ask questions, and share your expertise

can not start zookeeper

New Contributor


We were able to run zookeeper on our cluster, but it crushed and can not start any more. The error msg now is like this:

zookeeper cannot open channel to X at election address

and Could not find or load main class org.apache.zookeeper.server.quorum.QuorumPeerMain

I checked our zookeeper-3.4.6.jar is under kafka/libs and it is of the same version.

I also tried this but did not work:


Do you have any idea how to fix this problem?

Thank you very much for your help,


@xueqin pang Please paste last few entries from the log

New Contributor

thank you very much for your reply

we setup the log folder like this:


But there is nothing at all. I searched online, and did not find any other place we could find the log file. If there is any, could kindly point me to it?

When we start zookeeper we got these msges:

$ ./ start

JMX enabled by default

Using config: /home/ubuntu/software/zookeeper-3.4.6/bin/../conf/zoo.cfg

Starting zookeeper ... STARTED

But if I check status, I got:

$ ./ status

JMX enabled by default

Using config: /home/ubuntu/software/zookeeper-3.4.6/bin/../conf/zoo.cfg

Error contacting service. It is probably not running.


I find my ZK logs end up under /var/log/zookeeper , at least with the HD installations. Make sure that the log directory has the permissions to be written to by the ZK account; if it doesn't you won't see logs

@xueqin pang /etc/init.d/iptables stop

It's much easier to install and run Zookeeper using Ambari. If you want to install Zookeeper manually please follow the instructions given here:

You can skip Kerberos part if your cluster is not kerberized. Important checkpoints:

. myid files created on all 3 hosts, with numbers 1,2,3

. In zoo.cfg use FQDNs if possible, though IP addresses should work as well. Be sure that myid on server.i contains number i, i=1,2,3. For example, myid on server.1 must contain 1. Don't use, that will require specific zoo.cfg on each server, no need to do that (and not sure it would work at all).

. Create as given in the manual, and check all entries to match settings in your environment. Zookeeper log is given as ZOO_LOG_DIR.

. Distribute zoo.cfg and on all 3 hosts into the conf dir, usually /etc/zookeeper/conf

. Make sure ports 2888, 3888, 2181 are open on all 3 hosts, or if possible disable iptables

. Check permissions (section 3.4)

. start Zookeeper as zookeeper user providing ZOOCFGDIR, ZOOCFG etc. on the command line on all 3 hosts. Check the manual (section 3.6) for details.

That should be enough. I installed several Zookeepers manually (for Kafka) and had no issues.

New Contributor

Have you found any sollution for this issue? I'm also facing it, I've tried to install zookeeper in a total new server, but I'm getting the same problem.


@xueqin pang are you still having issues? Please accept the best answer or provide your own solution.