2012-02-09 70 views
4

我正在使用Hbase-Hadoop组合作为我的应用程序以及Data Nucleus作为ORM。错误HBASE-ZOOKEEPER:连接太多

当我试图通过多个线程在一次访问hbase。它抛出的例外如下:

Exception in thread "Thread-26" javax.jdo.JDODataStoreException 

org.apache.hadoop.hbase.ZooKeeperConnectionException: HBase is able to connect to ZooKeeper but the connection closes immediately. This could be a sign that the server has too many connections (30 is the default). Consider inspecting your ZK server logs for that error and then make sure you are reusing HBaseConfiguration as often as you can. See HTable's javadoc for more information. 

Caused by: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase 

如果需要我可以提供完整的堆栈跟踪(由于完整的堆栈跟踪使事情混乱在这里)。

请帮助我解决一些如何处理这种情况的线索。我需要做什么来增加连接池吗?

回答

7

动物园管理员服务器有一个活动连接数限制,默认为30 您需要在您的动物园管理员配置文件设置相应maxClientCnxns属性来增加此限制,zoo.cfg。

对于100连接:

maxClientCnxns=100 

要告诉饲养员征收没有限制连接数:

maxClientCnxns=0 
+0

感谢您的回复,我会尽快回复您 – devsri 2012-02-11 06:09:18

+0

在哪里可以找到zoo.cfg?我在hbase目录中的任何地方找不到它 – sunskin 2013-10-01 19:48:54

+1

它不在hbase目录内,它位于zookeeper conf目录中。如果您使用hbase管理zookeeper,则可以使用hbase-site.xml中的属性hbase.zookeeper.property.maxClientCnxns,但我不建议将它用于生产环境,因为它不适用于分布式模式。 – 2013-10-02 21:15:51

0

对于上面的问题,您需要重新启动的HBase的主服务。 为同一命令是

sudo /etc/init.d/hadoop-hbase-master start 

这需要进入到HBase的外壳之前完成。