Chinaunix首页 | 论坛 | 博客
  • 博客访问: 460270
  • 博文数量: 108
  • 博客积分: 25
  • 博客等级: 民兵
  • 技术积分: 1134
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-29 19:43
文章分类

全部博文(108)

文章存档

2016年(10)

2015年(9)

2014年(73)

2013年(16)

我的朋友

分类: HADOOP

2016-06-04 23:39:30

hbck是hbase里用来检测 region一致性,表完整性问题及修复损坏的命令行工具。它有2种工作模式:
  1. 只读不一致性识别模式(默认模式,但不尝试修复)
  2. 多阶段读写修复模式 (如果发现错误,则尝试修复)
注:如果只检查特定的表 则用: hbck ..
常用选项:
   1. -details 顾名词义,打印详细结果
   2. -fix 用来修复region级别的不一致性。其内部的操作顺序如下
  1. 先查是否存在不一致的。
  2. 如有表级别的不一致性,则先修复表的不一致问题。
  3. 如有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的最大数量。


阅读(2569) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~