Hbase2.2.1出现惊人大坑,为什么会出现oldWALs?导致磁盘空间莫名不断增加。

Hbase2.2.1出现惊人大坑,为什么会出现oldWALs?导致磁盘空间莫名不断增加。

【问题发现】突然有几天,没有进行写数据操作,但MASTER主节点的HDFS不断增加,而且是每10分钟增加1个G左右的大小,就是一个小时12G空间就明显没有了

 

【原因】

 

当/hbase/WALs中的HLog文件被持久化到存储文件中,且这些Hlog日志文件不再被需要时,就会被转移到{hbase.rootdir}/oldWALs目录下,该目录由HMaster上的定时任务负责定期清理。

HMaster在做定期清理的时候首先会检查zookeeper中/hbase/replication/rs下是否有对应的复制文件,如果有就放弃清理,如果没有就清理对应的hlog。在手动清理oldWALs目录数据的同时,如果没有删除对应的znode数据,就会导致HMaster不会自动清理oldWALs。

另附某网友的解答:

 

 

删除这部分的日志后,腾出将近300G的内存大小来。这个问题在CENTOS7.0的系统会产生这个问题的BUG值。

 

The folder gets cleaned regularly by a chore in master. When a WAL file is not needed any more for recovery purposes (when HBase can guaratee HBase has flushed all the data in the WAL file), it is moved to the oldWALs folder for archival. The log stays there until all other references to the WAL file are finished. There is currently two services which may keep the files in the archive dir. First is a TTL process, which ensures that the WAL files are kept at least for 10 min. This is mainly for debugging. You can reduce this time by setting hbase.master.logcleaner.ttl configuration property in master. It is by default 600000. The other one is replication. If you have replication setup, the replication processes will hang on to the WAL files until they are replicated. Even if you disabled the replication, the files are still referenced.

 

 

 

【解决】

 

(1) 进到zookeeper的节点下,删除相关节点

 

 

【原因】

 

 

(2) 确保hbase-site.xml中的属性hbase.replication=false和属性hbase.backup.enable=false 如果是true就改成false,如果没有那两个属性则添加上去后

重启整个hbase集群。

 

 

可以从截图中看到,原来300G的oldWALs,被hsmaster清理掉了:

 

 

  • 0
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值