集群外访问Hbase – access Hbase use a java client program
集群环境:
Master -
10.123.122.151 test-Master
Slave -
10.123.122.163 test-DATA01
10.123.122.162 test-DATA02
10.123.122.156 test-DATA03 (zookeeper)
由于需要以client方式访问hbase读写数据, 在原有环境hadoop-0.20.2+737 (cdh3) + hbase-0.89.20100924+28 + jdk-6u20 下总是不能成功连接,典型的错误如下:
Session establishment complete 但是无法继续下去(log4j 调整到 debug模式可以看到详细的日志信息)
[INFO] Initiating client connection, connectString=Test-DATA03:2181 sessionTimeout=60000 watcher=org.apache.hadoop.hbase.zookeeper.ZooKeeperWrapper@423e5d1
[DEBUG] zookeeper.disableAutoWatchReset is false
[DEBUG] <Test-DATA03:/hbase,org.apache.hadoop.hbase.client.HConnectionManager>Connected to zookeeper again
[INFO] Opening socket connection to server Test-DATA03/10.123.122.156:2181
[INFO] Socket connection established to Test-DATA03/10.123.122.156:2181, initiating session
[DEBUG] Session establishment request sent on Test-DATA03/10.123.122.156:2181
[INFO] Session establishment complete on server Test-DATA03/10.123.122.156:2181, sessionid = 0x1300c46dd880ba6, negotiated timeout = 60000
[DEBUG] Reading reply sessionid:0x1300c46dd880ba6, packet:: c