How to delete all the data and metadata in HBase WITHOUT uninstalling and reinstalling?

sangfroid picture sangfroid · Jun 28, 2012 · Viewed 8.8k times · Source

Running HBase in pseudo-distributed mode on my dev box. Cloudera CDH4. CentOS.

Somehow, my HBase installation has gotten totally corrupted. I ran this command :

./bin/hbase hbck -repairHoles

and the readout ended with this :

Summary:
  -ROOT- is okay.
    Number of regions: 1
    Deployed on:  localhost.localdomain,60020,1340917622717
  .META. is okay.
    Number of regions: 1
    Deployed on:  localhost.localdomain,60020,1340917622717
5 inconsistencies detected.

Looking at the documentation here :

http://hbase.apache.org/book/apbs03.html

it says this : If inconsistencies still remain after these steps, you most likely have table integrity problems related to orphaned or overlapping regions.

Basically, I have no interest in digging in and trying to fix this. I want to completely nuke my HBase installation and start over fresh and clean. HOWEVER, I do not want to do an uninstall/reinstall, because we use Cloudera, and I don't want to mess with their whole weird configuration and setup.

Is there a way to delete all the data and metadata in HBase WITHOUT uninstalling and reinstalling?

Answer

ankitk picture ankitk · Aug 15, 2012

I do not recommend this unless you are at the point of no return.

I do not know if this is the correct way to nuke the hbase data, but when I run into such inconsistencies I usually delete all the contents the directory which is holding hbase data. So the place would be look for the following property in hbase-site.xml
hbase.rootdir

I have not used this approach once the system got stable on my local dev machine. Usually if I shut down the cluster properly before shutting down the system, then I do not run into such problems.