3

我正在尝试连接到远程 HBase 服务器。远程服务器在 Ubuntu 上运行并且运行良好并且能够使用 Hbase 客户端(shell)以及 Java 客户端访问它。但是,当我尝试使用相同的 java 客户端从 Windows 机器连接到该服务器时

 org.apache.hadoop.conf.Configuration hadoopConf = HBaseConfiguration.create();
 hadoopConf.set("hbase.zookeeper.quorum", "Paras-Lenovo");

我收到以下错误:

27 May, 2013 4:03:50 PM org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper <init>
INFO: The identifier of this process is 2964@RDUBEY-PC
27 May, 2013 4:03:51 PM org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation shouldRetryGetMaster
INFO: getMaster attempt 0 of 10 failed; retrying after sleep of 1007
java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:599)
    at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
    at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:489)
    at org.apache.hadoop.hbase.ipc.HBaseClient$Connection.setupConnection(HBaseClient.java:390)
    at org.apache.hadoop.hbase.ipc.HBaseClient$Connection.setupIOstreams(HBaseClient.java:436)
    at org.apache.hadoop.hbase.ipc.HBaseClient.getConnection(HBaseClient.java:1124)
    at org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:974)
    at org.apache.hadoop.hbase.ipc.WritableRpcEngine$Invoker.invoke(WritableRpcEngine.java:86)
    at $Proxy19.getProtocolVersion(Unknown Source)
    at org.apache.hadoop.hbase.ipc.WritableRpcEngine.getProxy(WritableRpcEngine.java:138)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getMaster(HConnectionManager.java:712)
    at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:126)
    at com.alvazan.orm.layer9z.spi.db.hadoop.HadoopSession.start(HadoopSession.java:95)
    at com.alvazan.orm.logging.NoSqlRawLogger.start(NoSqlRawLogger.java:291)
    at com.alvazan.orm.impl.bindings.BootstrapImpl.createInstanceImpl(BootstrapImpl.java:55)
    at com.alvazan.orm.impl.bindings.BootstrapImpl.createInstance(BootstrapImpl.java:36)
    at com.alvazan.orm.api.base.Bootstrap.create(Bootstrap.java:65)
    at com.alvazan.orm.api.base.Bootstrap.create(Bootstrap.java:60)
    at com.alvazan.orm.api.base.Bootstrap.create(Bootstrap.java:57)
    at com.alvazan.ssql.cmdline.PlayOrm.main(PlayOrm.java:98)
27 May, 2013 4:03:52 PM org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation shouldRetryGetMaster
INFO: getMaster attempt 1 of 10 failed; retrying after sleep of 1005
org.apache.hadoop.hbase.ipc.HBaseClient$FailedServerException: This server is in the failed servers list: localhost/127.0.0.1:38812
    at org.apache.hadoop.hbase.ipc.HBaseClient$Connection.setupIOstreams(HBaseClient.java:425)
    at org.apache.hadoop.hbase.ipc.HBaseClient.getConnection(HBaseClient.java:1124)
    at org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:974)
    at org.apache.hadoop.hbase.ipc.WritableRpcEngine$Invoker.invoke(WritableRpcEngine.java:86)
    at $Proxy19.getProtocolVersion(Unknown Source)
    at org.apache.hadoop.hbase.ipc.WritableRpcEngine.getProxy(WritableRpcEngine.java:138)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getMaster(HConnectionManager.java:712)
    at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:126)
    at com.alvazan.orm.layer9z.spi.db.hadoop.HadoopSession.start(HadoopSession.java:95)
    at com.alvazan.orm.logging.NoSqlRawLogger.start(NoSqlRawLogger.java:291)

请注意,窗口主机文件中的条目很好,我可以从 Windows 机器远程登录 hbase/zookeper 端口的 60010 和 2181 端口,因此问题不是因为连接性。Hbase 客户端无法与远程 Hbase 服务器连接的问题与此类似,但这也不能解决问题。

4

3 回答 3

1

今天从客户端远程访问hbase时遇到了同样的错误,终于解决了。只是为了他人的利益而发布解决方法。

我在远程系统中用于 hbase java 客户端的库与 hadoop 系统中的库不同。一旦我使用了相同的库,这个问题就得到了解决。

于 2016-02-23T10:39:55.697 回答
0

禁用具有 hbase 服务器的机器的 ipv6 设置。然后一切都会好起来的。我之前遇到了同样的问题。

于 2013-06-19T09:19:14.517 回答
0

我发现这个讨论线程很有用http://apache-hbase.679495.n3.nabble.com/Where-is-HBase-failed-servers-list-stored-td4068803.html

如果您确定 IP 没有改变并且其他一切都可以使用 hbase shell 正常工作,那么重新启动 master 应该会有所帮助(这是我的情况)

于 2016-10-21T04:50:39.333 回答