Skip to content

Latest commit

 

History

History
66 lines (49 loc) · 2.35 KB

File metadata and controls

66 lines (49 loc) · 2.35 KB

Apache HBase Tool for repair metadata

MetaRepair is an utility tool for repairing hbase metadata table from hdfs regioninfo file. When using the Apache HBase™ versions before 2.0.3 and 2.1.1 (Without HBCK2), You can use it to fix the HBase metadata correctly.

Build

Run:

$ mvn install

The built hbase-meta-repair jar will be in the target sub-directory.

Setup

Make sure HBase tools jar is added to HBase classpath:

export HBASE_CLASSPATH=$HBASE_CLASSPATH:./hbase-meta-repair-1.1.0-SNAPSHOT.jar

Usage

MetaRepair requires an arguments as parameters: The name of the table to have metadata repaired.

For example, to repair metadata of table my-table , assuming the setup step above has been performed:

$ hbase org.apache.hbase.repair.MetaRepair my-table

The table with namespace use namespace:tablename form of parameter.

Implementation Details

HBase uses table hbase:meta to store metadata. The table structure is as follows:

Column Description
info:state region state
info:sn region server node, It consists of server and serverstartcode, such as slave1,16020,1557998852385
info:serverstartcode region server start timestamp
info:server region server address and port,such as slave1:16020
info:seqnumDuringOpen a binary string representing the online duration of the region
info:regioninfo same as the .regioninfo file

info:seqnumDuringOpen and info:serverstartcode will be automatically generated after the region server is restarted.