在hbck命令输出中出现“Found lingering reference file”

在hbck命令输出中出现“Found lingering reference file”

现象描述

残留的引用文件指的是连接hfile的引用文件,这个hfile在HDFS中是不存在。

Hback工具报出以下错误:

hbase/bin> hbase hbck
2016-03-08 17:57:55,858 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
INFO: Watching file:/home/pankaj/v1r2cxx/hbase/hbase/conf/log4j.properties for changes with interval : 60000
HBaseFsck command line options:

2016-03-08 17:57:58,179 INFO  [main] util.HBaseFsck: Checking and fixing region consistency
ERROR: Region { meta => null, hdfs => hdfs://10.10.106.212:8020/hbase/data/default/t1/7fbfdb516dff6013009143c4ba22cb89, deployed => , replicaId => 0 } 
on HDFS, but not listed in hbase:meta or deployed on any region server
2016-03-08 17:57:58,218 INFO  [main] util.HBaseFsck: Computing mapping of all store files

2016-03-08 17:57:58,253 INFO  [main] util.HBaseFsck: Validating mapping using HDFS state
ERROR: Found lingering reference file
hdfs://10.10.106.212:8020/hbase/data/default/t1/7fbfdb516dff6013009143c4ba22cb89/cf1/64d2e118ab1347a59aeb90f206853dc5.8fcda14355e599b20e8ea7f66f86b9d0
Summary:
Table hbase:meta is okay.
    Number of regions: 1
    Deployed on:  host-10-10-106-212,16020,1457430545905
Table hbase:acl is okay.
    Number of regions: 1
    Deployed on:  host-10-10-106-212,16020,1457430545905
Table t1 is okay.
    Number of regions: 2
    Deployed on:  host-10-10-106-212,16020,1457430545905
Table hbase:namespace is okay.
    Number of regions: 1
    Deployed on:  host-10-10-106-212,16020,1457430545905
2 inconsistencies detected.
Status: INCONSISTENT
2016-03-08 17:57:58,418 INFO  [main] client.ConnectionManager$HConnectionImplementation: Closing master protocol: MasterService
2016-03-08 17:57:58,418 INFO  [main] client.ConnectionManager$HConnectionImplementation: Closing zookeeper sessionid=0x10101ea9abf0181

可能原因

在一个故障场景,子region A在table目录下已经成功创建,但是在创建子region B的过程中region server出故障了。因此split region失败了并且在table目录的文件系统留下一个孤立的子目录。

当打开region,只清理”.split”目录,而不是孤立的子regions,这些孤立的子regions在先前失败的split操作过程中可能被移到table目录。因此将来,如果父region split成功,那么之前失败的子region A的引用hfile将会无效,hback将会报出以上错误。

定位思路

无。

处理步骤

  1. Hback工具提供命令-fixReferenceFiles来使这样残留的引用文件保留在其他位置。由于这会引起其他的不一致,请使用hbck -repair命令来解决这些不一致。 hbase hbck -repair <tableName>
  2. 运行hbck命令来复查-repair命令是否修复了所有的不一致。 hbase hbck 如果hback命令输出结果不一致,请重复1

参考信息

Hbck命令有很多其他选项,请运行以下命令来获得更详细的用法。

hbase hbck -help

关注公众号“大模型全栈程序员”回复“小程序”获取1000个小程序打包源码。更多免费资源在http://www.gitweixin.com/?p=2627

发表评论

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