2014-12-02 52 views
0

我已經在Linux機器上安裝了HBase(192.168.1.000),現在我已經在Eclipse IDE中使用JAVA API與HBase進行通信並且工作正常但在相同的Linux機器上編寫了一些示例代碼,當我在相同版本的Ecliple IDE的Windows機器上寫入相同的java代碼以與Linux機器上的HBase(192.168.1.000)進行通信時。我:無法通過java代碼遠程連接Hbase

14/12/02 15:42:40 INFO client.ZooKeeperSaslClient: Client will not SASL-authenticate because the   default JAAS configuration section 'Client' could not be found. If you are not using SASL, you may  ignore this. On the other hand, if you expected SASL to work, please fix your JAAS configuration. 
14/12/02 15:42:40 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error,  closing socket connection and attempting reconnect 
java.net.BindException: Cannot assign requested address: no further information 
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) 
at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source) 
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:286) 
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1035) 
14/12/02 15:42:40 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception:  org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/master 
14/12/02 15:42:40 INFO util.RetryCounter: The 1 times to retry after sleeping 2000 ms 

,而我的代碼是:

Configuration config = HBaseConfiguration.create(); 
config.clear(); 
config.set("hbase.zookeeper.quorum", "192.168.1.000"); 
config.set("hbase.zookeeper.property.clientPort","2181"); 
config.set("hbase.master", "192.168.1.000:60030"); 
HBaseAdmin hbAdmin = new HBaseAdmin(config);`enter code here` 

請幫我從這裏出去:

在此先感謝 阿比納夫·庫馬爾

+0

您確定這是正確的IP地址嗎? – atok 2014-12-02 10:27:43

回答

0

的BindException從您的堆棧跟蹤是當你嘗試運行你的hbase時,它會啓動一個端口2181協調器服務,即zookeeper,但是由於端口可能已經被其他一些程序使用ss,它會拋出BindException。

更改端口並重試。

+0

謝謝almas shaikh你的建議我照你說的做,但我得到了新的例外:未知主機ip6-192.168.1.12作爲我的usr /主機有配置192.168.1.12 \t localhost hbase 192.168.1.12 \t ngi-Satellite-Pro- B40-A #以下行期望用於IPv6的主機 :: 1 ip6-192.168.1.12 IP6回送 FE00 :: 0的IP6-localnet的 FF00 :: 0的IP6-mcastprefix FF02 :: 1 ip6- allnodes ff02 :: 2 ip6-allrouters as 192.168.1.12是hbase安裝位置的ip。 – 2015-01-21 10:21:09