无法使用Hbase连接到远程服务器

时间:2012-08-22 08:44:26

标签: java hadoop mapreduce hbase

我是Hadoop和Hbase的新手。我正在尝试从java代码创建一个表并连接到我的远程服务器(Hbase),即(172.80.72.86)。它是一台linux机器(172.80.72.86)。我试过上面的

我收到以下错误

12/08/22 14:06:49 INFO zookeeper.ZooKeeper: Client environment:zookeeper.version=3.3.5-1301095, built on 03/15/2012 19:48 GMT
12/08/22 14:06:49 INFO zookeeper.ZooKeeper: Client environment:host.name=user-8329a7141c
12/08/22 14:06:49 INFO zookeeper.ZooKeeper: Client environment:java.version=1.6.0_25
12/08/22 14:06:49 INFO zookeeper.ZooKeeper: Client environment:java.vendor=Sun Microsystems Inc.
12/08/22 14:06:49 INFO zookeeper.ZooKeeper: Client environment:java.home=C:\Program Files\Java\jre6
12/08/22 14:06:49 INFO zookeeper.ZooKeeper: Client environment:java.class.path=D:\workspace\Hbase\bin;C:\Documents and Settings\user\Desktop\HAdoop\jars\commons-cli-1.2.jar;C:\Documents and Settings\user\Desktop\HAdoop\jars\commons-logging-1.1.1.jar;C:\Documents and Settings\user\Desktop\HAdoop\jars\log4j-1.2.16.jar;C:\Documents and Settings\user\Desktop\HAdoop\jars\lib\hbase-dsl-0.1.2-SNAPSHOT.jar;C:\Documents and Settings\user\Desktop\HAdoop\jars\lib\commons-lang-2.5.jar;C:\Documents and Settings\user\Desktop\HAdoop\jars\lib\commons-logging-api-1.1.jar;C:\Documents and Settings\user\Desktop\HAdoop\jars\lib\hadoop-core-0.20.2.jar;C:\Documents and Settings\user\My Documents\Downloads\slf4j-1.6.6\slf4j-api-1.6.6.jar;C:\Documents and Settings\user\My Documents\Downloads\slf4j-1.6.6\slf4j-log4j12-1.6.6.jar;C:\Documents and Settings\user\Desktop\HAdoop\jars\lib\hbase-0.92.1.jar;C:\Documents and Settings\user\Desktop\HAdoop\jars\lib\zookeeper-3.3.5.jar
12/08/22 14:06:49 INFO zookeeper.ZooKeeper: Client environment:java.library.path=C:\Program Files\Java\jre6\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:\WINDOWS\system32;D:\oracle\product\10.2.0\db_1\bin;C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\servlet-api.jar;D:\Pervasive Stuff\New Training stuff\datarush-6.0.0-26\bin;C:\Program Files\Java\jdk1.6.0_25\bin;C:\Program Files\grails-2.0.4\bin;.;
12/08/22 14:06:49 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=C:\DOCUME~1\user\LOCALS~1\Temp\
12/08/22 14:06:49 INFO zookeeper.ZooKeeper: Client environment:java.compiler=<NA>
12/08/22 14:06:49 INFO zookeeper.ZooKeeper: Client environment:os.name=Windows XP
12/08/22 14:06:49 INFO zookeeper.ZooKeeper: Client environment:os.arch=x86
12/08/22 14:06:49 INFO zookeeper.ZooKeeper: Client environment:os.version=5.1
12/08/22 14:06:49 INFO zookeeper.ZooKeeper: Client environment:user.name=user
12/08/22 14:06:49 INFO zookeeper.ZooKeeper: Client environment:user.home=C:\Documents and Settings\user
12/08/22 14:06:49 INFO zookeeper.ZooKeeper: Client environment:user.dir=D:\workspace\Hbase
12/08/22 14:06:49 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=180000 watcher=hconnection
12/08/22 14:06:50 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
12/08/22 14:06:50 INFO zookeeper.RecoverableZooKeeper: The identifier of this process is 3416@user-8329a7141c
12/08/22 14:06:50 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
12/08/22 14:06:51 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/master
12/08/22 14:06:51 INFO util.RetryCounter: The 1 times to retry  after sleeping 2000 ms
12/08/22 14:06:52 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
12/08/22 14:06:53 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
12/08/22 14:06:53 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/master
12/08/22 14:06:53 INFO util.RetryCounter: The 2 times to retry  after sleeping 4000 ms
12/08/22 14:06:54 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
12/08/22 14:06:55 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
12/08/22 14:06:57 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
12/08/22 14:06:58 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
12/08/22 14:06:58 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/master
12/08/22 14:06:58 INFO util.RetryCounter: The 3 times to retry  after sleeping 8000 ms
12/08/22 14:07:00 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
12/08/22 14:07:01 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
12/08/22 14:07:02 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
12/08/22 14:07:03 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
12/08/22 14:07:05 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
12/08/22 14:07:06 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
12/08/22 14:07:06 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/master
12/08/22 14:07:06 ERROR zookeeper.RecoverableZooKeeper: ZooKeeper exists failed after 3 retries
12/08/22 14:07:06 WARN zookeeper.ZKUtil: hconnection Unable to set watcher on znode /hbase/master
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/master
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:90)
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:42)
    at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:815)
    at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.exists(RecoverableZooKeeper.java:154)
    at org.apache.hadoop.hbase.zookeeper.ZKUtil.watchAndCheckExists(ZKUtil.java:226)
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperNodeTracker.start(ZooKeeperNodeTracker.java:76)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.setupZookeeperTrackers(HConnectionManager.java:580)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.<init>(HConnectionManager.java:569)
    at org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:186)
    at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:194)
    at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:171)
    at HBaseConnector.main(HBaseConnector.java:20)
12/08/22 14:07:06 ERROR zookeeper.ZooKeeperWatcher: hconnection Received unexpected KeeperException, re-throwing exception
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/master
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:90)
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:42)
    at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:815)
    at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.exists(RecoverableZooKeeper.java:154)
    at org.apache.hadoop.hbase.zookeeper.ZKUtil.watchAndCheckExists(ZKUtil.java:226)
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperNodeTracker.start(ZooKeeperNodeTracker.java:76)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.setupZookeeperTrackers(HConnectionManager.java:580)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.<init>(HConnectionManager.java:569)
    at org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:186)
    at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:194)
    at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:171)
    at HBaseConnector.main(HBaseConnector.java:20)
12/08/22 14:07:06 FATAL client.HConnectionManager$HConnectionImplementation: Unexpected exception during initialization, aborting
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/master
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:90)
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:42)
    at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:815)
    at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.exists(RecoverableZooKeeper.java:154)
    at org.apache.hadoop.hbase.zookeeper.ZKUtil.watchAndCheckExists(ZKUtil.java:226)
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperNodeTracker.start(ZooKeeperNodeTracker.java:76)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.setupZookeeperTrackers(HConnectionManager.java:580)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.<init>(HConnectionManager.java:569)
    at org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:186)
    at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:194)
    at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:171)
    at HBaseConnector.main(HBaseConnector.java:20)
12/08/22 14:07:08 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
12/08/22 14:07:09 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
12/08/22 14:07:09 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/root-region-server
12/08/22 14:07:09 INFO util.RetryCounter: The 1 times to retry  after sleeping 2000 ms
12/08/22 14:07:10 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
12/08/22 14:07:11 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
12/08/22 14:07:11 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/root-region-server
12/08/22 14:07:11 INFO util.RetryCounter: The 2 times to retry  after sleeping 4000 ms
12/08/22 14:07:12 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
12/08/22 14:07:13 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
12/08/22 14:07:15 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
12/08/22 14:07:16 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
12/08/22 14:07:16 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/root-region-server
12/08/22 14:07:16 INFO util.RetryCounter: The 3 times to retry  after sleeping 8000 ms
12/08/22 14:07:18 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
12/08/22 14:07:19 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
12/08/22 14:07:20 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
12/08/22 14:07:21 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
12/08/22 14:07:23 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
12/08/22 14:07:24 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
12/08/22 14:07:25 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
12/08/22 14:07:26 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
12/08/22 14:07:26 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/root-region-server
12/08/22 14:07:26 ERROR zookeeper.RecoverableZooKeeper: ZooKeeper exists failed after 3 retries
12/08/22 14:07:26 WARN zookeeper.ZKUtil: hconnection Unable to set watcher on znode /hbase/root-region-server
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/root-region-server
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:90)
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:42)
    at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:815)
    at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.exists(RecoverableZooKeeper.java:154)
    at org.apache.hadoop.hbase.zookeeper.ZKUtil.watchAndCheckExists(ZKUtil.java:226)
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperNodeTracker.start(ZooKeeperNodeTracker.java:76)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.setupZookeeperTrackers(HConnectionManager.java:583)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.<init>(HConnectionManager.java:569)
    at org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:186)
    at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:194)
    at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:171)
    at HBaseConnector.main(HBaseConnector.java:20)
12/08/22 14:07:26 ERROR zookeeper.ZooKeeperWatcher: hconnection Received unexpected KeeperException, re-throwing exception
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/root-region-server
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:90)
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:42)
    at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:815)
    at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.exists(RecoverableZooKeeper.java:154)
    at org.apache.hadoop.hbase.zookeeper.ZKUtil.watchAndCheckExists(ZKUtil.java:226)
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperNodeTracker.start(ZooKeeperNodeTracker.java:76)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.setupZookeeperTrackers(HConnectionManager.java:583)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.<init>(HConnectionManager.java:569)
    at org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:186)
    at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:194)
    at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:171)
    at HBaseConnector.main(HBaseConnector.java:20)
12/08/22 14:07:26 FATAL client.HConnectionManager$HConnectionImplementation: Unexpected exception during initialization, aborting
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/root-region-server
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:90)
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:42)
    at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:815)
    at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.exists(RecoverableZooKeeper.java:154)
    at org.apache.hadoop.hbase.zookeeper.ZKUtil.watchAndCheckExists(ZKUtil.java:226)
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperNodeTracker.start(ZooKeeperNodeTracker.java:76)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.setupZookeeperTrackers(HConnectionManager.java:583)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.<init>(HConnectionManager.java:569)
    at org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:186)
    at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:194)
    at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:171)
    at HBaseConnector.main(HBaseConnector.java:20)
Exception in thread "main" java.io.IOException: org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation@b61fd1 closed
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:794)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:782)
    at org.apache.hadoop.hbase.client.HTable.finishSetup(HTable.java:249)
    at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:213)
    at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:171)
    at HBaseConnector.main(HBaseConnector.java:20)

2 个答案:

答案 0 :(得分:1)

指定zookeeper IP并继续。客户端Pc必须知道zookeeper在哪里运行。
在程序中的配置旁边添加以下行。

config.set("hbase.zookeeper.quorum", "172.80.72.86");  // Your remote Pc where the zookeeper is running. Mention the port if needed."172.80.72.86:60020"

答案 1 :(得分:0)

更好的方法是加载配置文件,而不是手动添加。

获取错误&#34;会话0x0为服务器null&#34;其中一个可能的问题是你的HBase代码不知道连接的位置。解决此问题的最佳方法是加载hbase-site.xml配置文件。

Configuration config = HBaseConfiguration.create();
config.addResource(new Path("/XXXX/hbase/hbase-0.98.9/conf/hbase-site.xml"));