无法让HBase连接到Hadoop

时间:2012-06-28 20:23:37

标签: hadoop hbase

编辑:我能够让它发挥作用。我创建了一个教程来说明如何: http://www.dreamsyssoft.com/blog/blog.php?/archives/5-How-to-use-HBase-Hadoop-Clustered.html

当我设置hbase-site.xml属性时,我可以正常工作:

<name>hbase.rootdir</name>
<value>file:///app/hbase/hbase/</value>

这很好用,它按预期将数据存储在目录中,但我希望它现在连接到我正在运行的hadoop实例而不是使用本地文件。我把它设置为

<value>hdfs://localhost:9000/</value>

而不是本地文件,它将无法正常工作。我是否需要在hadoop端进行一些额外的配置来支持这个? Hadoop正在运行并使用端口9000。

这是我来自hadoop的core-site.xml:

<configuration>
        <property>
                <name>fs.default.name</name>
                <value>hdfs://localhost:9000</value>
        </property>
</configuration>

这也是尝试在hbase shell中执行“list”时的错误:

hbase(main):001:0> list
TABLE
12/06/28 15:26:29 ERROR zookeeper.RecoverableZooKeeper: ZooKeeper exists failed after 3 retries
12/06/28 15:26:29 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:99)
        at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
        at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1021)
        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.HBaseAdmin.<init>(HBaseAdmin.java:98)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at org.jruby.javasupport.JavaConstructor.newInstanceDirect(JavaConstructor.java:275)
        at org.jruby.java.invokers.ConstructorInvoker.call(ConstructorInvoker.java:91)
        at org.jruby.java.invokers.ConstructorInvoker.call(ConstructorInvoker.java:178)

3 个答案:

答案 0 :(得分:0)

我相信Hbase找不到zookeeper仲裁,你必须在hbase-site.xml中设置hbase.zookeeper.quorum属性。还要检查classpath是否设置正确,请检查此doc

http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/mapreduce/package-summary.html#classpath

答案 1 :(得分:0)

我使用了http://hbase.apache.org/book.html#zookeeper中建议的配置 停止Ipatables并以root模式启动hbase。

答案 2 :(得分:0)