1.现象描述
集群修改参数后,需要对hbase服务进行重启操作,发现重启后master一直未选主成功
2.原因分析
- 查看hbase-master日志,发现日志一直在刷如下日志:
- 查看/hbase/MasterProcWALs/下的日志文件及大小,发现日志文件差不多共112W个,日志大小约4.5T
hadoop fs -ls /hbase/MasterProcWALs/
hadoop fs -du -s -h /hbase/MasterProcWALs
- master在选主过程中会回放MasterProcWAL日志,因日志文件太多,导致选主时间过长
3.解决方式
- 将MasterProcWAL日志文件mv到其他地方,并重启服务,选主成功
su hdfs
hadoop fs -mkdir /user/hadoop/MasterProcWALs
hadoop fs -mv /hbase/MasterProcWALs/* /user/hadoop/MasterProcWALs
- 集群可设置一个定时清理MasterProcWAL日志的脚本,避免出现相同的问题
hadoop fs -rm -r /hbase/MasterProcWALs/*
参考链接:
https://cloud.tencent.com/developer/article/1349438