Hbase 错误“错误:KeeperErrorCode = NoNode for/hbase/master" [英] Hbase Error "ERROR: KeeperErrorCode = NoNode for /hbase/master"

查看:646
本文介绍了Hbase 错误“错误:KeeperErrorCode = NoNode for/hbase/master"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

开始使用 HBASE:

 HOSTCHND:hbase-2.0.0 gvm$ ./bin/start-hbase.sh本地主机:运行zookeeper,登录到/usr/local/Cellar/hbase-2.0.0/bin/../logs/hbase-gvm-zookeeper-HOSTCHND.local.out运行 master,登录到/usr/local/Cellar/hbase-2.0.0/logs/hbase-gvm-master-HOSTCHND.local.out:运行 regionserver,登录到/usr/local/Cellar/hbase-2.0.0/logs/hbase-gvm-regionserver-HOSTCHND.local.out

在 HBASE SHELL 中检查状态时:

 hbase(main):001:0>地位错误:KeeperErrorCode = NoNode for/hbase/master显示集群状态.可以是摘要"、简单"、详细"或复制".这默认为摘要".例子:数据库>地位数据库>状态简单"数据库>状态摘要"数据库>状态详细"数据库>状态复制"数据库>状态复制",来源"数据库>状态复制",接收器"耗时 9.4096 秒hbase(main):002:0>

hbase-site.xml

<预><代码><配置><财产><name>hbase.rootdir</name><value>hdfs://localhost:9000/hbase</value></属性><财产><name>hbase.zookeeper.property.clientPort</name><value>2181</value></属性><财产><name>hbase.zookeeper.property.dataDir</name><value>/usr/local/Cellar/hbase-2.0.0/hbasestorage/zookeeper</value></属性><财产><name>hbase.cluster.distributed</name><值>真</值></属性><财产><name>hbase.zookeeper.quorum</name><value>本地主机</value></属性></配置>

请告诉我为什么在执行 hbase 命令时会发生此错误?

解决方案

就我而言,我收到了这个ERROR: KeeperErrorCode = NoNode for/hbase/master";因为 HMaster 进程没有运行.

使用 jps 命令检查.

hdusr@hdp-master-1:$ jps27504 主32755 数据节点23316 HQuorumPeer27957 日元第646话27097 HMaster23609 HRegionServer1562 大师1722 工人911 资源管理器32559 名称节点1167 节点管理器

如果您没有在上面的列表中看到 HMaster 进程,那么这就是 hbase shell 中 ERROR: KeeperErrorCode = NoNode. 的原因.

$HBASE_HOME/logs 目录中检查 hbase-***-master.log 是否有特定错误.

就我而言,有两个原因,

第一:

WARN [main-SendThread(localhost:2181)] zookeeper.ClientCnxn: Session 0x0 for server null,意外错误,关闭套接字连接并尝试重新连接java.net.ConnectException:连接超时

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

第二:

 ERROR [master/spark-hdp-master-1:16000:becomeActiveMaster] master.HMaster: 无法成为活动 masterorg.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.AccessControlException):org.apache.hadoop.security.AccessControlException:未启用简单身份验证.可用:[代币]

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

While executing any command in hbase shell, I am receiving the following error "ERROR: KeeperErrorCode = NoNode for /hbase/master" in hbase shell.

Started 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

While Checking status in 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> 

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>

Please let me know why this error happens while executing hbase commands?

解决方案

In my case I was receiving this "ERROR: KeeperErrorCode = NoNode for /hbase/master" because HMaster process was not running.

Check with jps command.

hdusr@hdp-master-1:$ jps
27504 Main
32755 DataNode
23316 HQuorumPeer
27957 Jps
646 SecondaryNameNode
27097 HMaster
23609 HRegionServer
1562 Master
1722 Worker
911 ResourceManager
32559 NameNode
1167 NodeManager

If you don't see HMaster process as in above list then that's the reason for ERROR: KeeperErrorCode = NoNode. in hbase shell.

In $HBASE_HOME/logs directory check for hbase-***-master.log for specific error.

In my case there were 2 reasons ,

First :

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

Which I solved by replacing 'localhost' with 'my machine's hostname' in hbase-site.xml. from this answer

Second :

    ERROR [master/spark-hdp-master-1:16000:becomeActiveMaster] master.HMaster: Failed to become active masterorg.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.AccessControlException): org.apache.hadoop.security.AccessControlException: SIMPLE authentication is not enabled.  Available:[TOKEN]

This was because the hdfs port in hbase-site.xml was different than that in core-site.xml of hadoop.

这篇关于Hbase 错误“错误:KeeperErrorCode = NoNode for/hbase/master"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆