Zookeeper connection error

Zookeeper connection error

zookeeper connection refused
zookeeper client
socket error occurred: localhost/0:0:0:0:0:0:0:1:2181: connection refused
zookeeper quickstart
zookeeper not running
zookeeper high availability
zookeeper download
unable to canonicalize address zookeeper:2181 because its not resolvable

We have a standalone zookeeper setup on a dev machine. It works fine for every other dev machine except this one testdev machine.

We get this error over and over again when trying to connect to zookeeper through testdev:

2012-11-09 14:06:53,909 - INFO  [main-SendThread(zk01.dev.bunchball.net:2181):ClientCnxn$SendThread@947] - Socket connection established to zk01.dev.bunchball.net/192.168.8.58:2181, initiating session
2012-11-09 14:06:53,911 - INFO  [main-SendThread(zk01.dev.bunchball.net:2181):ClientCnxn$SendThread@1183] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2012-11-09 14:06:55,366 - INFO  [main-SendThread(zk01.dev.bunchball.net:2181):ClientCnxn$SendThread@1058] - Opening socket connection to server zk01.dev.bunchball.net/192.168.8.58:2181
2012-11-09 14:06:55,368 - INFO  [main-SendThread(zk01.dev.bunchball.net:2181):ClientCnxn$SendThread@947] - Socket connection established to zk01.dev.bunchball.net/192.168.8.58:2181, initiating session
2012-11-09 14:06:55,368 - INFO  [main-SendThread(zk01.dev.bunchball.net:2181):ClientCnxn$SendThread@1183] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2012-11-09 14:06:57,271 - INFO  [main-SendThread(zk01.dev.bunchball.net:2181):ClientCnxn$SendThread@1058] - Opening socket connection to server zk01.dev.bunchball.net/192.168.8.58:2181
2012-11-09 14:06:57,274 - INFO  [main-SendThread(zk01.dev.bunchball.net:2181):ClientCnxn$SendThread@947] - Socket connection established to zk01.dev.bunchball.net/192.168.8.58:2181, initiating session
2012-11-09 14:06:57,275 - INFO  [main-SendThread(zk01.dev.bunchball.net:2181):ClientCnxn$SendThread@1183] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect

We tried restarting the test dev machine, and also restart zookeeper host but nothing worked. We are totally confused why it works perfectly fine with other machines except this one. What might be the cause of this?


I just have the same situation as you and I have just fixed this problem.

It is the reason that you have configured even number of zookeepers which directly result in this problem,try to change your number of zookeeper node to a odd one.

for example the original status of my zookeeper cluster is consisted of 4 nodes,then just remove one of them which result in the number of node to be 3 well ,now its ok to startup zookeeper cluster

below is the output of successfully connect to zookeeper server

2013-04-22 22:07:05,654 [myid:] - INFO  [main:ZooKeeper@438] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@1321ed6
Welcome to ZooKeeper!
2013-04-22 22:07:05,704 [myid:] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@966] - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
JLine support is enabled
2013-04-22 22:07:05,727 [myid:] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@849] - Socket connection established to localhost/127.0.0.1:2181, initiating session
[zk: localhost:2181(CONNECTING) 0] 2013-04-22 22:07:05,846 [myid:] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1207] - Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x13e3211c06e0000, negotiated timeout = 30000

Zookeeper Connection Loss Errors, Network connectivity problems​; I/O starvation​; GC starvation; Client-side timeouts; Limited by maxSessionTimeout if set to too low value  Zookeeper connection error - Stack Overflow We have a standalone zookeeper setup on a dev machine. It works fine for every other dev machine except this one testdev machine. We get this error over and over again when trying to connect to


I faced the same issue and found it was due to zookeeper cluster nodes needs ports opened to communicate with each other.

server.1=xx.xx.xx.xx:2888:3888

server.2=xx.xx.xx.xx:2888:3888

server.3=xx.xx.xx.xx:2888:3888

once i allowed these ports through aws security group and restarted. All worked fine for me

Solved: Cannot connect to zookeeper server from zookeeper , Error connecting to ZooKeeper server. Hi, I've run into a ZooKeeper connection error during the execution of a Nutch hadoop job. The tasks  I try connet Kafka docker to zookeeper and show me below erorr: Opening socket connection to server zookeeper:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn) My Execure Command for crea


I have just solved the problem. I am using centos 7. And the trouble-maker is firewall.Using "systemctl stop firewalld" to shut it all down in each server can simply solve the problem.Or you can use command like

firewall-cmd --zone=public --add-port=2181/udp --add-port=2181/tcp --permanent" to configure all three ports ,include 2181,2888,3888 in each server.And then "firewall-cmd --reload

Finally use

zkServer.sh restart

to restart your servers and problem solved.

How do I troubleshoot Zookeeper connection timeout issues, Opening socket connection to server zookeeper:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper. Are the servers coming up? Likely not given: server.1=localhost:2878:3878 server.2=localhost:2879:3879 server.3=localhost:2880:3880 If you are running all three servers on the same host they will need to each have a different config - in particular the datadir location must be different, and you need to assure that each datadir has a myid file corresponding to the server line (ie server.# in


In my case, I config zoo.cfg like this:

server.1=host-1:2888:3888
server.2=host-2:2888:3888
server.3=host-3:2888:3888

But, in host-1, I config host-1 resolve to 127.0.0.1 in /etc/hosts:

127.0.0.1   localhost host-1

which may results other hosts can't communicate with it. Resolve host-1 to its real ip solved this problem.

Hope this can help.

Error connecting to ZooKeeper server, I using docker for running kafka and zookeeper. Kafka container stopped and can​'t connect to zookeeper. Kafka showed error Opening socket  Solved: Hi, I'm trying to set up data flow by using a GetKafka processor to pull data from a Kafka cluster and a PutFile to save it on local file.


I had this problem too, and it turned out that I was telling zookeeper to connect to the wrong port. Have you verified that zookeeper is actually running on port 2181 on the dev machine?

Error Connect to Zookeeper · Issue #37 · bitnami/bitnami-docker , XX:2181, unexpected error, closing socket connection and attempting reconnect (​org.apache.zookeeper.ClientCnxn) java.io.IOException:  In my HDP cluster, I install 3 zookeeper-servers on 3 nodes, other nodes I just only install zookeeper-client. When I stand on Zookeeper-Server nodes, I can run zookeeper-client command OK. But when I stand on Zookeeper-Client nodes, I run zookeeper-client and can not connect to zookeeper servers 20


Kafka: Opening socket connection to server localhost/127.0.0.1 , Handling Errors; Connecting to ZooKeeper; Read Operations; Write Operations If an unrecoverable error occurs, such as session expiration or authentication  I found this thread while looking for a solution to my specific problem with Kafka not being able to connect to Zookeeper. In your case, I think it's only a delay in Zookeeper to start up and get ready to receive connections (listening to the socket).


Zookeeper connection Error when listing the topic in kafka cluster , ERROR: "org.apache.zookeeper. ClientCnxn: Opening socket connection to server ClientCnxn: Socket connection established to  More specifically, a ZooKeeper server uses this port to connect followers to the leader. When a new leader arises, a follower opens a TCP connection to the leader using this port. Because the default leader election also uses TCP, we currently require another port for leader election.


ZooKeeper Programmer's Guide, Re: Zookeeper connection error Seems your log attachment didn't come through the apache mailer. But you are right that, Kylin simply put up a command line from "kylin.source.hive.client" and "kylin.source.hive.beeline-params".