HBase hbck 命令詳解

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的最大數量。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章