我正在尝试连接到远程 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 服务器连接的问题与此类似,但这也不能解决问题。