当前位置:   article > 正文

HBase 提示:ERROR: KeeperErrorCode = NoNode for /hbase/master_no node for hbase master

no node for hbase master

环境配置:

Hadoop-3.0.3

HBase-2.1.0

ZooKeeper-3.4.12

问题说明:

  1. #切换至HBase-2.1.0 的安装目录下的bin文件夹
  2. cd /usr/local/hadoop/hbase-2.1.0/bin
  3. #启动HBase-2.1.0 服务
  4. start-hbase.sh
  5. #启动HBase-2.1.0 的shell 命令窗口,执行如下指令
  6. hbase shell
  7. #验证HBase 服务是否成功时,出现如下错误信息:
  8. [root@master bin]# hbase shell
  9. SLF4J: Class path contains multiple SLF4J bindings.
  10. SLF4J: Found binding in [jar:file:/usr/local/hadoop/hadoop-3.0.3/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
  11. SLF4J: Found binding in [jar:file:/usr/local/hadoop/hbase-2.1.0/lib/client-facing-thirdparty/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
  12. SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
  13. SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
  14. HBase Shell
  15. Use "help" to get list of supported commands.
  16. Use "exit" to quit this interactive shell.
  17. Version 2.1.0, re1673bb0bbfea21d6e5dba73e013b09b8b49b89b, Tue Jul 10 17:26:48 CST 2018
  18. Took 0.0021 seconds
  19. hbase(main):001:0> status
  20. ERROR: KeeperErrorCode = NoNode for /hbase/master
  21. For usage try 'help "status"'
  22. Took 8.2867 seconds

查看HBase-2.1.0 的错误日志文件夹(/usr/local/hadoop/hbase-2.1.0/logs)下,打印的错误日志信息:

  1. java.lang.NoClassDefFoundError: org/apache/htrace/SamplerBuilder
  2. at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:635)
  3. at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:619)
  4. at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:149)
  5. at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2669)
  6. at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:94)
  7. at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2703)
  8. at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2685)
  9. at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:373)
  10. at org.apache.hadoop.fs.Path.getFileSystem(Path.java:295)
  11. at org.apache.hadoop.hbase.util.CommonFSUtils.getRootDir(CommonFSUtils.java:358)
  12. at org.apache.hadoop.hbase.util.CommonFSUtils.isValidWALRootDir(CommonFSUtils.java:407)
  13. at org.apache.hadoop.hbase.util.CommonFSUtils.getWALRootDir(CommonFSUtils.java:383)
  14. at org.apache.hadoop.hbase.regionserver.HRegionServer.initializeFileSystem(HRegionServer.java:691)
  15. at org.apache.hadoop.hbase.regionserver.HRegionServer.<init>(HRegionServer.java:600)
  16. at org.apache.hadoop.hbase.master.HMaster.<init>(HMaster.java:484)
  17. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  18. at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
  19. at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  20. at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
  21. at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:2965)
  22. at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:236)
  23. at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:140)
  24. at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
  25. at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:149)
  26. at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:2983)
  27. Caused by: java.lang.ClassNotFoundException: org.apache.htrace.SamplerBuilder
  28. at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
  29. at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  30. at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
  31. at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  32. ... 25 more
  33. 2018-08-01 23:30:33,794 ERROR [main] master.HMasterCommandLine: Master exiting
  34. java.lang.RuntimeException: Failed construction of Master: class org.apache.hadoop.hbase.master.HMaster.
  35. at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:2972)
  36. at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:236)
  37. at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:140)
  38. at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
  39. at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:149)
  40. at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:2983)
  41. Caused by: java.lang.NoClassDefFoundError: org/apache/htrace/SamplerBuilder
  42. at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:635)
  43. at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:619)
  44. at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:149)
  45. at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2669)
  46. at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:94)
  47. at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2703)
  48. at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2685)
  49. at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:373)
  50. at org.apache.hadoop.fs.Path.getFileSystem(Path.java:295)
  51. at org.apache.hadoop.hbase.util.CommonFSUtils.getRootDir(CommonFSUtils.java:358)
  52. at org.apache.hadoop.hbase.util.CommonFSUtils.isValidWALRootDir(CommonFSUtils.java:407)
  53. at org.apache.hadoop.hbase.util.CommonFSUtils.getWALRootDir(CommonFSUtils.java:383)
  54. at org.apache.hadoop.hbase.regionserver.HRegionServer.initializeFileSystem(HRegionServer.java:691)
  55. at org.apache.hadoop.hbase.regionserver.HRegionServer.<init>(HRegionServer.java:600)
  56. at org.apache.hadoop.hbase.master.HMaster.<init>(HMaster.java:484)
  57. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  58. at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
  59. at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  60. at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
  61. at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:2965)
  62. ... 5 more
  63. Caused by: java.lang.ClassNotFoundException: org.apache.htrace.SamplerBuilder
  64. at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
  65. at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  66. at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
  67. at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  68. ... 25 more

解决办法:

将/usr/local/hadoop/hbase-2.1.0/lib/client-facing-thirdparty/htrace-core-3.1.0-incubating.jar 文件拷贝至/usr/local/hadoop/hbase-2.1.0/lib文件夹中 ,执行如下指令:

[root@master client-facing-thirdparty]# cp /usr/local/hadoop/hbase-2.1.0/lib/client-facing-thirdparty/htrace-core-3.1.0-incubating.jar /usr/local/hadoop/hbase-2.1.0/lib

拷贝相关jar 文件后,重新启动HBase-2.1.0 ,验证HBase 服务是否正常启动。但是shell 窗口还是提示错误信息,错误的日志内容如下:

java.lang.IllegalStateException: The procedure WAL relies on the ability to hsync for proper operation during component failures, but the underlying filesystem does not support doing so. Please check the config value of 'hbase.procedure.store.wal.use.hsync' to set the desired level of robustness and ensure the config value of 'hbase.wal.dir' points to a FileSystem mount that can provide it.

解决版本:

修改HBase-2.1.0的hbase-site.xml,添加如下内容:

  1. <property>
  2. <name>hbase.unsafe.stream.capability.enforce</name>
  3. <value>false</value>
  4. </property>

重新启动HBase-2.1.0 服务,执行相关指令结果如下:

  1. [root@master bin]# hbase shell
  2. SLF4J: Class path contains multiple SLF4J bindings.
  3. SLF4J: Found binding in [jar:file:/usr/local/hadoop/hadoop-3.0.3/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
  4. SLF4J: Found binding in [jar:file:/usr/local/hadoop/hbase-2.1.0/lib/client-facing-thirdparty/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
  5. SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
  6. SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
  7. HBase Shell
  8. Use "help" to get list of supported commands.
  9. Use "exit" to quit this interactive shell.
  10. Version 2.1.0, re1673bb0bbfea21d6e5dba73e013b09b8b49b89b, Tue Jul 10 17:26:48 CST 2018
  11. Took 0.0030 seconds
  12. hbase(main):001:0> status
  13. 1 active master, 0 backup masters, 2 servers, 0 dead, 1.0000 average load
  14. Took 0.5673 seconds
  15. hbase(main):002:0> list
  16. TABLE
  17. 0 row(s)
  18. Took 0.0435 seconds
  19. => []
  20. hbase(main):003:0> exit

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/632706
推荐阅读
相关标签
  

闽ICP备14008679号