Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase >> mail # user >> How to clear hbase data in zookeeper


Copy link to this message
-
Re: How to clear hbase data in zookeeper
Hi,

I have tried to use the 'big hammer' before, here are my steps (it is not recommended and you should have your HBase and ZK shut down first):

### shut down ZM and HBase
1) for each ZK node:
su // login as root
cd $ZOOKEEPER_HOME
cp data/myid myid // backup existing myid file to ZooKeeper's home folder
rm data/* -Rf
rm dadalog/* -Rf
mkdir -p data
mkdir -p datalog
cp myid data/myid // restore the myid backup so no need to recreate myid again

2) for each ZK node:
(start ZK )

3) finally
(start HBase)

By clearing data and datalog, you should have a very clean ZooKeeper.
Hope these help and good luck.
Thanks
ac

On 1 Dec 2012, at 10:55 AM, Kevin O'dell wrote:

> Stephen,
>
>  There are a couple ways you can do this.  The first is the small hammer
> assuming ZK is using /hbase you can log into the ZK from a ZK node using
> /usr/lib/zookeeper/bin/zkCli.sh once you are in the shell you can then
> execute a rmr /hbase and this will remove all the HBase data except the id
> of the ZK node.  Please make sure HBase is shut down.
>
>  There is a REALLY big hammer, some may call is a sledge hammer but you
> can delete the ZK data dir.  Go to each ZK node and from the shell as root
> execute a rm -rf /<path to zk data> I believe the default is
> /var/lib/zookeeper/version-2.  Again this is not recommended and you should
> have both HBase and ZK shut down for this.
>
> On Fri, Nov 30, 2012 at 8:42 PM, Stephen Boesch <[EMAIL PROTECTED]> wrote:
>
>> It is my intention to clean the zookeeper info, since getting questionable
>> behavior in hbase.
>>
>> what is the process to view/clear the data (hbase..) in zookeeper?
>>
>> To view it i tried something like:
>>
>> java -cp zookeeper.jar:lib/*:conf org.apache.zookeeper.ZooKeeperMain ls /
>> hscaler-cn001:2181
>>
>> I get an output of
>>
>> Connecting to localhost:2181
>> log4j:WARN No appenders could be found for logger
>> (org.apache.zookeeper.ZooKeeper).
>> log4j:WARN Please initialize the log4j system properly.
>>
>> WATCHER::
>>
>> WatchedEvent state:SyncConnected type:None path:null
>> [hbase, zookeeper]
>>
>>
>> I"m not sure how to get more specific info (using /hbase for example
>> results in same info..)
>>
>> Also: how to remove all of the hbase related data in zookeeper ?
>>
>> Thanks!
>>
>
>
>
> --
> Kevin O'Dell
> Customer Operations Engineer, Cloudera
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB