Wednesday, February 15, 2012

ZooKeeper Increase maximum number of connections

When using zookeeper you may get the following exception:

KeeperErrorCode = ConnectionLoss for /foo.XXXXXXXX
at org.apache.zookeeper.KeeperException.create(

At the same time if you view the log of zookeeper you will see the the following warning :

WARN org.apache.zookeeper.server.NIOServerCnxn: Too many connections from / - max is 10

This is due to the default maximum number of connections configured in zookeeper.

You can overcome this by setting up the maximum number of connections in zoo keeper configuration file.(conf/zoo.cfg)

Add following entry to zoo.cfg file and restart zooKeeper. It will set maximum number of connections to 30.


1 comment: