When using zookeeper you may get the following exception:
KeeperErrorCode = ConnectionLoss for /foo.XXXXXXXX
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 /127.0.0.1 - 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.