我已经设置了本地hbase,一切都在hbase shell上正常运行。在运行status命令时,我可以看到以下输出。
1 active master, 0 backup masters, 1 servers, 0 dead, 3.0000 average load
但是,当我尝试在java中运行以下行时 -
Configuration hBaseConfiguration = HBaseConfiguration.create();
hBaseConfiguration.set("hbase.zookeeper.quorum", "localhost");
hBaseConfiguration.set("hbase.zookeeper.property.clientPort", "2181");
hBaseConfiguration.set("zookeeper.znode.parent", "/hbase");
HBaseAdmin.available(hBaseConfiguration);
它给了我例外
Caused by: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
at org.apache.zookeeper.KeeperException.create(KeeperException.java:99)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
at org.apache.hadoop.hbase.zookeeper.ReadOnlyZKClient$ZKTask$1.exec(ReadOnlyZKClient.java:189)
at org.apache.hadoop.hbase.zookeeper.ReadOnlyZKClient.run(ReadOnlyZKClient.java:323)
at java.lang.Thread.run(Thread.java:748)
你可以给我任何帮助吗?