我安装了Hadoop2.2.0和Hbase0.98.0,这是我的工作:

$ ./bin/start-hbase.sh

$ ./bin/hbase shell

2.0.0-p353 :001 > list

然后我得到了:
ERROR: Can't get master address from ZooKeeper; znode data == null

为什么会出现此错误?另一个问题:
在运行base之前需要运行./sbin/start-dfs.sh./sbin/start-yarn.sh吗?

另外,./sbin/start-dfs.sh./sbin/start-yarn.sh用于什么?

这是我的一些conf文件:

hbase-sites.xml
<configuration>
    <property>
        <name>hbase.rootdir</name>
        <value>hdfs://127.0.0.1:9000/hbase</value>
    </property>
    <property>
        <name>hbase.cluster.distributed</name>
        <value>true</value>
    </property>

    <property>
        <name>hbase.tmp.dir</name>
        <value>/Users/apple/Documents/tools/hbase-tmpdir/hbase-data</value>
    </property>
    <property>
        <name>hbase.zookeeper.quorum</name>
        <value>localhost</value>
    </property>
    <property>
        <name>hbase.zookeeper.property.dataDir</name>
        <value>/Users/apple/Documents/tools/hbase-zookeeper/zookeeper</value>
    </property>
</configuration>

core-sites.xml
<configuration>

  <property>
      <name>fs.defaultFS</name>
      <value>hdfs://localhost:9000</value>
      <description>The name of the default file system.</description>
  </property>

  <property>
      <name>hadoop.tmp.dir</name>
      <value>/Users/micmiu/tmp/hadoop</value>
      <description>A base for other temporary directories.</description>
  </property>

  <property>
      <name>io.native.lib.available</name>
      <value>false</value>
  </property>

</configuration>

yarn-sites.xml
<configuration>

    <property>
        <name>yarn.nodemanager.aux-services</name>
        <value>mapreduce_shuffle</value>
    </property>

    <property>
        <name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name>
        <value>org.apache.hadoop.mapred.ShuffleHandler</value>
    </property>

</configuration>

最佳答案

如果只想运行HBase而不进入独立HBase的Zookeeper管理,则从property中删除所有名为hbase-site.xml的属性块之外的hbase.rootdir块。

现在运行/bin/start-hbase.sh。 HBase带有自己的Zookeeper,当您运行/bin/start-hbase.sh时,它便会启动,如果您是第一次尝试解决问题,这将足够。稍后,您可以为Zookeeper放置分布式模式配置。

您只需要运行/sbin/start-dfs.sh即可运行HBase,因为hbase.rootdir中的hdfs://127.0.0.1:9000/hbase的值设置为hbase-site.xml。如果使用file:///some_location_on_local_filesystem将其更改为文件系统本地的某个位置,则甚至不需要运行/sbin/start-dfs.sh
hdfs://127.0.0.1:9000/hbase表示这是在HDFS上的位置,并且/sbin/start-dfs.sh启动namenode和datanode,它们提供了用于访问HDFS文件系统的基础API。要了解有关Yarn的信息,请查看http://hadoop.apache.org/docs/r2.3.0/hadoop-yarn/hadoop-yarn-site/YARN.html

09-28 06:17
查看更多