Java客户端连接HBase报错:Not a host:port pair

一、环境:

JDK:1.7.0_25

Hadoop:1.1.2(伪分布式安装)

HBase:0.94.9(伪分布式安装)

二、问题:

用Java客户端连接HBase时,报错:如下:

13/07/24 09:08:02 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=127.0.0.1:2181 sessionTimeout=180000 watcher=hconnection

13/07/24 09:08:02 INFO zookeeper.ClientCnxn: Opening socket connection to server /127.0.0.1:2181

13/07/24 09:08:02 INFO zookeeper.ClientCnxn: Socket connection established to ubuntu/127.0.0.1:2181, initiating session

13/07/24 09:08:02 INFO zookeeper.ClientCnxn: Session establishment complete on server ubuntu/127.0.0.1:2181, sessionid = 0x1400e1e58d00011, negotiated timeout = 40000

 

Exception in thread "main" java.lang.IllegalArgumentException: Not a host:port pair: �

at org.apache.hadoop.hbase.HServerAddress.<init>(HServerAddress.java:60)

at org.apache.hadoop.hbase.MasterAddressTracker.getMasterAddress(MasterAddressTracker.java:63)

at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getMaster(HConnectionManager.java:353)

at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:89)

at com.hbase.HBaseTestCase.create(HBaseTestCase.java:25)

 

at com.hbase.HBaseTestCase.main(HBaseTestCase.java:82)

二、分析:

       经过上网查资料,发现HBase Jar版本不对,服务器HBase版本为0.94.9,但是Jar包用了 0.90.2,改回用 0.94.9的jar包,问题解决 。

你可能感兴趣的:(Java客户端连接HBase报错:Not a host:port pair)