Community Articles

Find and share helpful community-sourced technical articles.
Announcements
Celebrating as our community reaches 100,000 members! Thank you!
Labels (1)
avatar

HBaseFsck (hbck) is a tool for checking for region consistency and table integrity problems and repairing a corrupted HBase. It works in two basic modes — a read-only inconsistency identifying mode and a multi-phase read-write repair mode.

To check to see if your HBase cluster has corruptions, run hbck against your HBase cluster:

$ ./bin/hbase hbck

At the end of the commands output it prints OK or tells you the number of INCONSISTENCIES present. You may also want to run hbck a few times because some inconsistencies can be transient (e.g. cluster is starting up or a region is splitting). Operationally you may want to run hbck regularly and setup alert if it repeatedly reports inconsistencies . A run of hbck will report a list of inconsistencies along with a brief description of the regions and tables affected. The using the -details option will report more details including a representative listing of all the splits present in all the tables.

$ ./bin/hbase hbck -details

If you just want to know if some tables are corrupted, you can limit hbck to identify inconsistencies in only specific tables. For example the following command would only attempt to check table TableFoo and TableBar. The benefit is that hbck will run in less time.

$ ./bin/hbase hbck TableFoo TableBar

Best Practices:

● Redirect output to a file hbase hbck >>/tmp/hbck.txt

● Larger clusters run table specific hbck fixes

hbase hbck –fixMeta mytable

● Avoid running hbck with –repair flag.

11,923 Views
Comments
avatar
New Contributor

For an article named "in depth" this a pretty shallow article. Considering the man page for hbck is longer than this article, I guess I expected a treatise on how to interpret the output, how to determine which fix parameters to run, etc.