hbase与java客户端的连接

时间:2016-05-03 13:06:32

标签: java maven hadoop hbase

我有一个java程序( eclipse , Maven , windows7)来填充Hbase来自服务的VirtualBox, 当我从eclipse运行它时,程序运行正常。

但是,当我使用executable jar中的assembly plugin创建Maven并从cmdcygwin运行时,我收到此错误

> [2016-05-03 14:46:44,663][DEBUG] Reading reply sessionid:0x154769ed563000a, packet:: clientPath:null serverPath:null finished:false header:: 300,4  replyHeader:: 300,3632,-101  request:: '/hbase-unsecure/meta-region-server,F  response:: [2016-05-03 14:46:44,663][DEBUG] hconnection-0x6b63f5ff-0x154769ed563000a, quorum=sandbox:2181, baseZNode=/hbase-unsecure Unable to get data of znode /hbase-unsecure/meta-region-server because node does not exist (not an error) [2016-05-03 14:46:44,663][DEBUG] Looked up meta region location, connection=org.apache.hadoop.hbase.client.ZooKeeperRegistry@695e5335; servers = null [2016-05-03 14:46:44,689][DEBUG] Closing scanner id=-1

>org.apache.hadoop.hbase.client.RetriesExhaustedException: Can't get the locations
        at org.apache.hadoop.hbase.client.RpcRetryingCallerWithReadReplicas.getRegionLocations(RpcRetryingCallerWithReadReplicas.java:312)
        at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:153)
        at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:61)
        at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:200)
        at org.apache.hadoop.hbase.client.ClientScanner.call(ClientScanner.java:320)
        at org.apache.hadoop.hbase.client.ClientScanner.nextScanner(ClientScanner.java:295)
        at org.apache.hadoop.hbase.client.ClientScanner.initializeScannerInConstruction(ClientScanner.java:160)
        at org.apache.hadoop.hbase.client.ClientScanner.<init>(ClientScanner.java:155)
        at org.apache.hadoop.hbase.client.HTable.getScanner(HTable.java:811)
        at org.apache.hadoop.hbase.MetaTableAccessor.fullScan(MetaTableAccessor.java:602)
        at org.apache.hadoop.hbase.MetaTableAccessor.tableExists(MetaTableAccessor.java:366)
        at org.apache.hadoop.hbase.client.HBaseAdmin.tableExists(HBaseAdmin.java:303)
        at org.apache.hadoop.hbase.client.HBaseAdmin.tableExists(HBaseAdmin.java:313)

你们中有谁可以帮我这个吗?

1 个答案:

答案 0 :(得分:0)

以下更多信息可能会有所帮助。在具有“hbase”命令的虚拟框中运行这些命令

hbase zkCli -server sandbox:2181

连接后,您可以在zkcli提示符下运行:

ls /

请粘贴上述命令的输出。 “/ hbase-unsecure”的baseZnode似乎不存在。通常,基本znode是“/ hbase”。

请按照@RamPrasadG

的建议,通过java代码交叉检查正在运行的程序的类路径
System.out.println(System.getProperty("java.classpath"))