查看日志,得到关键错误信息
2021-02-01 20:37:33,784 FATAL [vm002:16000.activeMasterManager] master.HMaster: Failed to become active master
java.net.ConnectException: Call From vm002/192.168.11.131 to vm002:9000 failed on connection exception: java.net.ConnectException: 拒绝连接; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
百度master.HMaster: Failed to become active master
原因是hadoop的配置文件core-site.xml中的参数fs.defaultFS的值用的是localhost,而hbase的配置文件的hbase-site.xml中的参数hbase.rootdir用的是hostname,虽然表示的意思是一样的,但是没有统一,所以挂了,我的都修改为hostname后,启动成功,并且HMaster没有再挂。
参考:
https://www.cnblogs.com/shirui/p/8624520.html
https://community.cloudera.com/t5/Support-Questions/Hbase-Failed-to-become-active-master/td-p/226759
网上也有这样的错误日志,第一行都是master.HMaster: Failed to become active master
,第二行不一样。
ERROR [master/h136:16000:becomeActiveMaster] master.HMaster: Failed to become active master
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-site.xml 中添加:
<property>
<name>hbase.unsafe.stream.capability.enforce</name>
<value>false</value>
</property>