错误HBASE-ZOOKEEPER:连接太多 [英] Error HBASE-ZOOKEEPER : Too many connections

查看:451
本文介绍了错误HBASE-ZOOKEEPER:连接太多的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



当我试图通过多个线程在同一时间访问hbase时,我的应用程序中使用了Hbase-Hadoop组合。它会抛出异常:

 线程Thread-26中的异常javax.jdo.JDODataStoreException 

org.apache.hadoop.hbase.ZooKeeperConnectionException:HBase能够连接到ZooKeeper,但连接立即关闭。这可能表示服务器连接太多(默认为30)。考虑检查您的ZK服务器日志中是否存在该错误,然后确保尽可能经常重复使用HBaseConfiguration。有关更多信息,请参阅HTable的javadoc。

导致:org.apache.zookeeper.KeeperException $ ConnectionLossException:KeeperErrorCode = ConnectionLoss for / hbase

如果需要的话,我可以提供完整的堆栈跟踪(由于完整的堆栈跟踪会让这个东西变得麻烦)。



请帮助我解决一些问题带领如何处理这种情况。是否有任何配置需要增加连接池?

解决方案

Zookeeper服务器有一个活动连接限制,默认情况下
您需要通过在您的zookeeper配置文件zoo.cfg中相应地设置maxClientCnxns属性来增加此限制。



对于100个连接:

  maxClientCnxns = 100 

告诉zookeeper对连接数量没有限制:

  maxClientCnxns = 0 


I am using Hbase-Hadoop combination for my application along with Data Nucleus as the ORM.

When I am trying to access hbase via several threads at a single time. It throws exceptions as :

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

If required I can provide the complete stack trace.(Since the complete stack trace makes thing messy out here).

Kindly help me out with some leads on how to handle this kind of situation. Is there any configuration I need to do to increase the connection pool?

解决方案

Zookeeper servers have an active connections limit, which by default is 30. You need to increase this limit by setting maxClientCnxns property accordingly in your zookeeper config file, zoo.cfg.

For 100 connections:

maxClientCnxns=100

To tell zookeeper to impose no limit to the number of connections:

maxClientCnxns=0

这篇关于错误HBASE-ZOOKEEPER:连接太多的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆