Hbase客户端ConnectionLoss for / hbase错误 [英] Hbase client ConnectionLoss for /hbase error

查看:4462
本文介绍了Hbase客户端ConnectionLoss for / hbase错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我完全疯了:

安装Hadoop / Hbase,全部正在运行;

  /opt/jdk1.6.0_24/bin/jps 
23261 ThriftServer
22582 QuorumPeerMain
21969 NameNode
23500 Jps
23021 HRegionServer
22211 TaskTracker
22891 HMaster
22117 SecondaryNameNode
21779 DataNode
22370 Main
22704 JobTracker

伪分布式环境。



hbase shell



正在运行,并且正在运行'list'和

  hbase shell 
HBase Shell;输入'help< RETURN>'获取支持的命令列表。
输入exit< RETURN>离开HBase Shell
版本0.90.1-cdh3u0,r,Fri Mar 25 16:10:51 PDT 2011

hbase(main):001:0>状态
1个服务器,0个死亡,8.0000个平均负载

通过ruby&节俭,一切工作正常;我们正在添加数据,它正在进入系统,我们可以查询/扫描它。一切似乎都很好。



但是,当连接到Java时:

  groovy> import org.apache.hadoop.hbase.HBaseConfiguration 
groovy> import org.apache.hadoop.hbase.client.HBaseAdmin
groovy> conf = HBaseConfiguration.create()
groovy> conf.set( hbase.master, 127.0.0.1:60000);
groovy> hbase = new HBaseAdmin(conf);

抛出的异常

org.apache.hadoop.hbase.ZooKeeperConnectionException:org.apache.hadoop.hbase.ZooKeeperConnectionException:org.apache.zookeeper.KeeperException $ ConnectionLossException:KeeperErrorCode = ConnectionLoss for / hbase
在org.apache.hadoop.hbase.client.HConnectionManager $ HConnectionImplementation.getZooKeeperWatcher(HConnectionManager.java:1000)
在org.apache.hadoop.hbase.client.HConnectionManager $ HConnectionImplementation。 setupZookeeperTrackers(HConnectionManager.java:303)
at org.apache.hadoop.hbase.client.HConnectionManager $ HConnectionImplementation。< init>(HConnectionManager.java:294)
at org.apache.hadoop.hbase .client.HConnectionManager.getConnection(HConnectionManager.java:156)
at org.apache.hadoop.hbase.client.HBaseAdmin。< init>(HBaseAdmin.java:84)

我一直在努力寻找原因,但我确实没有任何线索。一切似乎都已正确安装。

  netstat -lnp | grep 60000 
tcp6 0 0 ::: 60000 ::: * LISTEN 22891 / java

看起来很好。

 #telnet localhost 60000 
尝试127.0.0.1 ...
连接到本地主机。
转义字符是'^]'。

如果你输入任何东西+输入,连接并死亡(不确定这是否是主意,9090节俭一样)。



任何人都可以帮助我吗?

解决方案

Charles, 这是一个Zookeeper(ZK)错误。 HBase客户端尝试从Zookeeper获取/ hbase节点并失败。

您可以从HBase主Web界面获取ZK转储。你应该看到与ZK的所有连接,并找出是否有什么耗尽它们。

在进入其他任何事情之前,您可以尝试重新启动ZK集群,看看它是否能解决您的问题。 (奇怪的是,你看到一个客户端)。

HBase有一个设置来增加连接ZK的数量。它是

  hbase.zookeeper.property.maxClientCnxns 

最近有几个与默认连接数有关的更新(见下文)(有一个hbase-default.xml文件具有所有默认配置)。
您可以在hbase-site.xml文件(在HBase conf目录下)中覆盖它,并将其提高到100或更高。但要确保你没有以这种方式掩盖真正的问题,你不应该看到一个客户端的问题。



我们有类似的情况,但在升级到HBase-0.90之后,它正在从map-reduce作业的繁重操作中发生。

以下是一些与您的问题相关的问题:



如果您仍然无法解决问题,请发送电子邮件至hbase-users列表或加入freenode上的#hbase频道并提问现场问题。

I'm going completely crazy:

Installed Hadoop/Hbase, all is running;

/opt/jdk1.6.0_24/bin/jps
23261 ThriftServer
22582 QuorumPeerMain
21969 NameNode
23500 Jps
23021 HRegionServer
22211 TaskTracker
22891 HMaster
22117 SecondaryNameNode
21779 DataNode
22370 Main
22704 JobTracker

Pseudo distributed environment.

hbase shell

is working and coming up with correct results running 'list' and;

hbase shell
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 0.90.1-cdh3u0, r, Fri Mar 25 16:10:51 PDT 2011

hbase(main):001:0> status
1 servers, 0 dead, 8.0000 average load

When connecting via ruby & thrift, everything is working fine; we are adding data, it's getting in the system, we can query/scan it. Everything seems fine.

However, when connecting with Java:

groovy> import org.apache.hadoop.hbase.HBaseConfiguration 
groovy> import org.apache.hadoop.hbase.client.HBaseAdmin 
groovy> conf = HBaseConfiguration.create() 
groovy> conf.set("hbase.master","127.0.0.1:60000"); 
groovy> hbase = new HBaseAdmin(conf); 

Exception thrown

org.apache.hadoop.hbase.ZooKeeperConnectionException: org.apache.hadoop.hbase.ZooKeeperConnectionException: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getZooKeeperWatcher(HConnectionManager.java:1000)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.setupZookeeperTrackers(HConnectionManager.java:303)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.<init>(HConnectionManager.java:294)
    at org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:156)
    at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:84)

I've been trying to find the cause, but I really have no clue at all. Everything seems to be correctly installed.

netstat -lnp|grep 60000
tcp6       0      0 :::60000                :::*                    LISTEN      22891/java  

Looks fine as well.

# telnet localhost 60000
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

Connects and dies if you type anything + enter (not sure if that's the idea, thrift on 9090 does the same).

Can anyone help me?

解决方案

Charles,

This is a Zookeeper(ZK) error. The HBase client tries to get the /hbase node from Zookeeper and fails.

You can get a ZK dump from the HBase master web interface. You should see all the connections to ZK and figure out if something is exhausting them.

Before diving into anything else you could try restarting your ZK cluster and see if it fixes your problem. (It's strange that you see that with a single client).

HBase has a setting to increase the number of connections to ZK. It's

hbase.zookeeper.property.maxClientCnxns

There were a few updates (see below) lately related to the default number of connections (there's a hbase-default.xml file that has all the default configurations). You can override this in your hbase-site.xml file (under HBase conf dir) and raise it to 100 or more. But make sure you're not masking the real problem this way, you shouldn't see this problem with a single client.

We've had a similar situation, but it was happening during heavy operations from map-reduce jobs, after upgrading to HBase-0.90.

Here are a couple of issue related to your problem:

If you still can't figure it out send an email to the hbase-users list or join the #hbase channel on freenode and ask live questions.

这篇关于Hbase客户端ConnectionLoss for / hbase错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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