HBase整集群异常crash

1、集群crash故障原因

前段时间一个生产HBase集群发生了整集群的RegionServer节点先后出现退出(挂掉),大致的故障产生原因如下:
1)另外一个生产HBase集群几周前开启了复制功能,,但是完成存量数据迁移后,切断复制后(disable),但是没有删除replication peer
2)这种情况下,集群的WAL会保持不删除,oldWALs体积一直增长;
3)随着单个目录下WALs文件个数越来越多,达到dfs.namenode.fs-limits.max-directory-items(默认1048576)参数的限制
4)这个时候再写入WAL文件时,会出现IO错误,导致RegionServer进程写WAL失败,触发Aborting region。

2019-10-04 13:26:20,280 ERROR [B.defaultRpcServer.handler=109,queue=5,port=16000] master.MasterRpcServices: Region server hbase-1,16020,1569257374303 r
eported a fatal error:
ABORTING region server hbase-1,16020,1569257374303: IOE in log roller
Cause:
org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.hdfs.protocol.FSLimitException$MaxDirectoryItemsExceededException): The directory item limit of /apps/hbase/data/o
ldWALs is exceeded: limit=1048576 items=1048576
        at org.apache.hadoop.hdfs.server.namenode.FSDirectory.verifyMaxDirItems(FSDirectory.java:1131)
        at org.apache.hadoop.hdfs.server.namenode.FSDirRenameOp.verifyFsLimitsForRename(FSDirRenameOp.java:117)


2、fs.namenode.fs-limits.max-directory-items参数

单个目录下,文件和目录的最大个数,默认值为1048576 (hadoop-2.7.x)

<property>
  <name>dfs.namenode.fs-limits.max-directory-items</name>
  <value>1048576</value>
  <description>Defines the maximum number of items that a directory may
      contain. Cannot set the property to a value less than 1 or more than
      6400000.</description>
</property>

当时oldWALs的大小大约146 * 3= 483T, 执行remove_peer 之后空间逐渐释放。


3、一些故障总结

1)分布式集群的虽然整体可用性比较高,能容忍部分节点失败,但是整个集群不可用的概率仍然存在。因而对于核心集群,是需要做必要容灾集群(包括跨区容灾),以防极端状况发生。
2)对于异常crash的大集群,恢复比较慢。恢复时,注意hamster gc是不是太小,可以适当增大相关的线程参数(找时间补充)。


[参考资料]

http://hadoop.apache.org/docs/r2.7.1/hadoop-project-dist/hadoop-hdfs/hdfs-default.xml
https://stackoverflow.com/questions/6358611/what-is-the-maximum-number-of-files-allowed-in-a-hdfs-directory

此条目发表在Hadoop, hbase分类目录。将固定链接加入收藏夹。

发表评论

邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据