hbase shell无法使用:error:keeperrorcode=nonode for/hbase/master

neskvpey  于 2021-06-08  发布在  Hbase
关注(0)|答案(3)|浏览(742)

我尝试安装 hbasepseudo-distributed 模式。由于这个问题,我现在不能使用hbase。系统中的所有代码 hbase shell无法运行,所有这些程序都会收到以下错误提示:
错误:keeperrorcode=nonode for/hbase/master
在我的ubuntu 17中,我安装了 hadoop ,我相信我的 hdfs 位置匹配我的 hbase :

  1. hdfs://localhost:9000

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

  1. <configuration>
  2. <property>
  3. <name>hbase.rootdir</name>
  4. <value>hdfs://localhost:9000/hbase</value>
  5. </property>
  6. <property>
  7. <name>hbase.cluster.distributed</name>
  8. <value>true</value>
  9. </property>
  10. <property>
  11. <name>dfs.replication</name>
  12. <value>1</value>
  13. </property>

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

  1. <configuration>
  2. <property>
  3. <name>hadoop.tmp.dir</name>
  4. <value>file:/usr/local/hadoop/tmp</value>
  5. <description>A base for other tmp dir</description>
  6. </property>
  7. <property>
  8. <name>fs.defaultFS</name>
  9. <value>hdfs://localhost:9000</value>
  10. </property>

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

  1. 6737 DataNode
  2. 7749 HRegionServer
  3. 6582 NameNode
  4. 6968 SecondaryNameNode
  5. 7529 HQuorumPeer
  6. 9148 Jps

登录 http://localhost:16010/master-status ,可以看到日志:
未能变为活动状态:该过程依赖于hsync功能,以便在组件故障期间正常运行,但底层文件系统不支持这样做。请检查“hbase.procedure.store.wal.use.hsync”的配置值以设置所需的健壮性级别,并确保“hbase.wal.dir”的配置值指向可以提供它的文件系统装载(从2秒前开始)

2cmtqfgy

2cmtqfgy1#

在我的情况下,我收到了这个“ ERROR: KeeperErrorCode = NoNode for /hbase/master “因为hmaster进程没有运行。正如你提到的,你的主人也不在跑步。
我不明白 hbase.zookeeper.quorum 属性。添加并检查。

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

如果hmaster还没开始 $HBASE_HOME/logs 目录检查 hbase-***-master.log 对于特定错误。
对我来说有两个原因,
第一:

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

我通过将“localhost”替换为“my machine's hostname”来解决这个问题 hbase-site.xml . 从这个答案
第二:

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

这是因为hdfs端口 hbase-site.xml 和以前不一样 core-site.xml hadoop的一部分。
在这里回答。

展开查看全部
62o28rlo

62o28rlo2#

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

  1. <configuration>
  2. <property>
  3. <name>hbase.unsafe.stream.capability.enforce</name>
  4. <value>false</value>
  5. </property>
  6. <property>
  7. <name>zookeeper.znode.parent</name>
  8. <value>/hbase</value>
  9. </property>
  10. </configuration>

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

mrphzbgm

mrphzbgm3#

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

  1. 1: Hadoop - 3.2.0
  2. 2: Zookeeper - 3.5.5
  3. 3: HBase - 2.2.0

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

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

2:更改了hbase-site.xml

  1. <configuration>
  2. <property>
  3. <name>hbase.rootdir</name>
  4. <value>hdfs://localhost:9000/hbase</value>
  5. </property>
  6. <property>
  7. <name>hbase.cluster.distributed</name>
  8. <value>true</value>
  9. </property>
  10. <property>
  11. <name>dfs.replication</name>
  12. <value>1</value>
  13. </property>
  14. <property>
  15. <name>hbase.unsafe.stream.capability.enforce</name>
  16. <value>false</value>
  17. </property>
  18. <property>
  19. <name>zookeeper.znode.parent</name>
  20. <value>/hbase</value>
  21. </property>
  22. </configuration>

三: start-all.sh 4: zkServer.sh start 5: start-hbase.sh 5:jps能够列出hmaster和hregionserver

  1. madhuri@**-****:$ jps
  2. 10688 HRegionServer
  3. 4194 DataNode
  4. 4019 NameNode
  5. 10532 HMaster
  6. 4468 SecondaryNameNode
  7. 10309 QuorumPeerMain
  8. 4902 NodeManager
  9. 11162 Main
  10. 11740 Jps
  11. 4718 ResourceManager
  12. madhuri@**-****:$

6:查询hbase:

  1. hbase(main):003:0> list
  2. TABLE
  3. mytable
  4. 1 row(s)
  5. Took 0.0138 seconds
  6. => ["mytable"]
  7. hbase(main):004:0> scan 'mytable'
  8. ROW COLUMN+CELL
  9. first column=cf:message, timestamp=1565095359573, value=hello HB
  10. ase
  11. second column=cf:foo, timestamp=1565095375215, value=0
  12. third column=cf:bar, timestamp=1565095394172, value=3.14159
  13. 3 row(s)
  14. Took 0.0186 seconds
  15. hbase(main):005:0>

**如果一切顺利 hbase shell 返回结果需要更长的时间,然后请转到zk目录-我的是 /tmp/zookeeper (它存在于zoo.cfg文件中)并删除所有内容,然后尝试重新启动上述服务。zk似乎有问题。

希望它能帮助别人!

展开查看全部

相关问题