Hbase 错误“错误:KeeperErrorCode = NoNode for /hbase/master”

use*_*163 5 hadoop hbase hdfs apache-zookeeper

在 hbase shell 中执行任何命令时,我在 hbase shell 中收到以下错误“ERROR: KeeperErrorCode = NoNode for /hbase/master”。

启动HBASE:

    HOSTCHND:hbase-2.0.0 gvm$ ./bin/start-hbase.sh
    localhost: running zookeeper, logging to /usr/local/Cellar/hbase-2.0.0/bin/../logs/hbase-gvm-zookeeper-HOSTCHND.local.out
    running master, logging to /usr/local/Cellar/hbase-2.0.0/logs/hbase-gvm-master-HOSTCHND.local.out
    : running regionserver, logging to /usr/local/Cellar/hbase-2.0.0/logs/hbase-gvm-regionserver-HOSTCHND.local.out
Run Code Online (Sandbox Code Playgroud)

在 HBASE SHELL 中检查状态时:

    hbase(main):001:0> status

    ERROR: KeeperErrorCode = NoNode for /hbase/master

    Show cluster status. Can be 'summary', 'simple', 'detailed', or 'replication'. The
    default is 'summary'. Examples:

    hbase> status
    hbase> status 'simple'
    hbase> status 'summary'
    hbase> status 'detailed'
    hbase> status 'replication'
    hbase> status 'replication', 'source'
    hbase> status 'replication', 'sink'

   Took 9.4096 seconds                                                             
   hbase(main):002:0> 
Run Code Online (Sandbox Code Playgroud)

hbase-site.xml

<configuration>
<property>
    <name>hbase.rootdir</name>
    <value>hdfs://localhost:9000/hbase</value>
</property>
<property>
    <name>hbase.zookeeper.property.clientPort</name>
    <value>2181</value>
</property>
<property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>/usr/local/Cellar/hbase-2.0.0/hbasestorage/zookeeper</value>
</property>
<property>
    <name>hbase.cluster.distributed</name>
    <value>true</value>
</property>
<property>
    <name>hbase.zookeeper.quorum</name>
    <value>localhost</value>
</property>
</configuration>
Run Code Online (Sandbox Code Playgroud)

请告诉我为什么执行 hbase 命令时会出现此错误?

Hbn*_*ing 0

首先,确保主机文件中已设置 IP 和主机名映射。

其次,修改HBase临时目录位置。临时目录数据会定期清空。临时目录的默认值是在/tmp更改它们hbase-site.xml

<property>
        <name>hbase.tmp.dir</name>
        <value>/hbase/tmp</value>
        <description>Temporary directory on the local filesystem.</description>
</property>
Run Code Online (Sandbox Code Playgroud)

如果它不起作用。清理hbase数据目录,同时清理zookeeper中的元数据再次重新启动hbase。

更重要的是,检查你的 ntp 和防火墙。