【问题标题】:hbase shell cannot use: ERROR: KeeperErrorCode = NoNode for /hbase/masterhbase shell 无法使用:错误:KeeperErrorCode = NoNode for /hbase/master
【发布时间】:2018-05-08 08:49:18
【问题描述】:

我尝试在pseudo-distributed 模式下安装hbase。由于这个问题,我现在不能使用 hbase。 hbase shell 中的每个代码都无法运行,并且都得到了这个错误提示:

错误:KeeperErrorCode = NoNode for /hbase/master

在我的 ubuntu 17 中,我安装了 hadoop,我确定我的 hdfs 位置与我的 hbase 匹配:

hdfs://localhost:9000

这是我在 hbase-site.xml 中的hbase-config

<configuration>
<property>
    <name>hbase.rootdir</name>
    <value>hdfs://localhost:9000/hbase</value>
</property>
<property>
    <name>hbase.cluster.distributed</name>
    <value>true</value>
</property>
<property>
    <name>dfs.replication</name>
    <value>1</value>
</property>

我在 core-site.xml 中的hdfs-config

<configuration>
<property>
    <name>hadoop.tmp.dir</name>
    <value>file:/usr/local/hadoop/tmp</value>
    <description>A base for other tmp dir</description>
</property>
<property>
    <name>fs.defaultFS</name>
    <value>hdfs://localhost:9000</value>
</property>

我可以开始hbase,但过了一会儿,HMaster 消失了:

6737 DataNode
7749 HRegionServer
6582 NameNode
6968 SecondaryNameNode
7529 HQuorumPeer
9148 Jps

登录http://localhost:16010/master-status,可以看到日志:

无法激活:过程 WAL 依赖于在组件故障期间进行正确操作的能力,但底层文件系统不支持这样做。请检查“hbase.procedure.store.wal.use.hsync”的配置值以设置所需的稳健性级别,并确保“hbase.wal.dir”的配置值指向可以提供它的文件系统挂载。 (从 2 秒前开始)

【问题讨论】:

  • 我在最近的 HBase 2.x beta 版本中遇到了类似的问题,而在稳定的 1.x 版本中一切正常。您使用的是 2.x 测试版吗?
  • 是的,我猜是版本问题引起的

标签: hbase apache-zookeeper master


【解决方案1】:

我在使用 HBase 独立模式时也遇到了同样的问题。 jps 能够列出 HMaster 服务,但是当我启动 'hbase shell' 并发出任何命令时,它会抛出 ERROR: KeeperErrorCode = NoNode for /hbase/master 并且 HMaster 服务会突然终止。所以在伪分布式模式下使用Hbase。

我正在使用 -

1: Hadoop - 3.2.0

2: Zookeeper - 3.5.5

3: HBase - 2.2.0

1:我在 hbase-env.sh 中更改了以下属性,因为我想使用单独的 ZK 服务而不是在 HBase 中嵌入一个 -

# Tell HBase whether it should manage it's own instance of ZooKeeper or not.
export HBASE_MANAGES_ZK=false

2:更改了 hbase-site.xml

<configuration>
  <property>
    <name>hbase.rootdir</name>
    <value>hdfs://localhost:9000/hbase</value>
  </property>
  <property>
    <name>hbase.cluster.distributed</name>
    <value>true</value>
  </property>
  <property>
    <name>dfs.replication</name>
    <value>1</value>
  </property>
  <property>
    <name>hbase.unsafe.stream.capability.enforce</name>
    <value>false</value>
  </property>
  <property>
    <name>zookeeper.znode.parent</name>
    <value>/hbase</value>
  </property>
</configuration>

3:start-all.sh 4:zkServer.sh start 5:start-hbase.sh

5: jps 可以列出 HMaster 和 HRegionServer

madhuri@**-****:$ jps
10688 HRegionServer
4194 DataNode
4019 NameNode
10532 HMaster
4468 SecondaryNameNode
10309 QuorumPeerMain
4902 NodeManager
11162 Main
11740 Jps
4718 ResourceManager
madhuri@**-****:$ 

6:查询HBase:

hbase(main):003:0> list
TABLE                                                                           
mytable                                                                         
1 row(s)
Took 0.0138 seconds                                                             
=> ["mytable"]
hbase(main):004:0> scan 'mytable'
ROW                   COLUMN+CELL                                               
 first                column=cf:message, timestamp=1565095359573, value=hello HB
                      ase                                                       
 second               column=cf:foo, timestamp=1565095375215, value=0           
 third                column=cf:bar, timestamp=1565095394172, value=3.14159     
3 row(s)
Took 0.0186 seconds                                                             
hbase(main):005:0> 

**如果一切顺利,但hbase shell 仍然需要更长的时间才能返回结果,那么请转到 ZK 目录 - 我的是 /tmp/zookeeper(它存在于 zoo.cfg 文件中)并删除所有内容并尝试在上面重新启动提到的服务。 ZK 好像有点问题。

希望对某人有所帮助!

【讨论】:

    【解决方案2】:

    确保您的 hbase-site.xml 文件中有以下两部分。 当我遇到同样的问题时,解决这些问题为我解决了:

    <configuration>
      <property>
        <name>hbase.unsafe.stream.capability.enforce</name>
        <value>false</value>
      </property>
    
      <property>
        <name>zookeeper.znode.parent</name>
        <value>/hbase</value>
      </property>
    </configuration>
    

    如果这仍然不能解决问题,请注意 hbase 日志文件中的条目。

    【讨论】:

      【解决方案3】:

      在我的情况下,我收到了这个“ERROR: KeeperErrorCode = NoNode for /hbase/master”,因为 HMaster 进程没有运行。正如你提到的,你的 HMaster 也没有运行。

      我在您的 hbase-site.xml 中没有看到 hbase.zookeeper.quorum 属性。添加并检查。

      <property>
      <name>hbase.zookeeper.quorum</name>
      <value>hdp-master-1</value>
      </property>
      

      如果 HMaster 仍然没有启动,则在 $HBASE_HOME/logs 目录中检查 hbase-***-master.log 是否有特定错误。

      就我而言,有两个原因,

      第一:

      WARN  [main-SendThread(localhost:2181)] zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
      java.net.ConnectException: Connection timed out
      

      我通过在hbase-site.xml 中将“localhost”替换为“我的机器的主机名”来解决这个问题。从这个答案

      第二:

      WARN  [main-SendThread(localhost:2181)] zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
      java.net.ConnectException: Connection timed out
      

      这是因为hbase-site.xml中的hdfs端口与hadoop的core-site.xml中的不同。

      已回复here

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-08-05
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多