HBase hbck 命令详解

来源:互联网 发布:英语社交网络 编辑:程序博客网 时间:2024/05/21 16:58

hbck是hbase里用来检测 region一致性,表完整性问题及修复损坏的命令行工具。它有2种工作模式:
只读不一致性识别模式(默认模式,但不尝试修复)
多阶段读写修复模式 (如果发现错误,则尝试修复)
注:如果只检查特定的表 则用: hbck ..
常用选项:
1. -details 顾名词义,打印详细结果
2. -fix 用来修复region级别的不一致性。其内部的操作顺序如下
先查是否存在不一致的。
如有表级别的不一致性,则先修复表的不一致问题。
如有region级别的不一致性,则修复该级别的问题。在修复期间region是关闭状态
也可以通过其它方式来修复不一致性,如下:
-fixAssignments repairs unassigned, incorrectly assigned or multiply assigned regions. 修复没有分配的,已分配但不正确的单个region或者多个region。
-fixMeta removes rows from hbase:meta when their corresponding regions are not present in HDFS and adds new meta rows if regions are present in HDFS but not in hbase:meta. 当从hbase:meta表相关的region在hdfs里找到,则移除这些行。如果这些region在hdfs里,则在hbase.meta里增加新的行
-repairHoles creates HFiles for new empty regions on the filesystem and ensures that the new regions are consistent. 在空的region里新建一个HFiles,却表新的region是一致的。
-fixHdfsOrphans repairs a region directory that is missing a region metadata file (the .regioninfo file).在region目录里 修复那些缺失region元数据的文件如(.regioninfo)
-fixHdfsOverlaps fixes overlapping regions. You can further tune this argument using the following options: 修复重叠的regions。与此同时结合以下选项:
-maxMerge controls the maximum number of regions to merge. 控制最大合并region的数量。
-sidelineBigOverlaps attempts to sideline the regions which overlap the largest number of other regions. 尝试退出那些与其它region有最大数量的重叠的region
-maxOverlapsToSideline limits the maximum number of regions to sideline. 限制退出region的最大数量。

0 0
原创粉丝点击