[ 
https://issues.apache.org/jira/browse/HBASE-7244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13622411#comment-13622411
 ] 

rajeshbabu commented on HBASE-7244:
-----------------------------------

[~stack]
bq.  Can you provide evidence this script actually works?
Started hbase cluster and stopped all hbase related processes then ran the 
clean up script.
Here are the logs I can provide for evidence. One of my colleague using in 
cluster testing when ever needed cleanup.
It checks any hbase processes master,regionservers and backup masters are alive 
or not. If no process is alive only it will delete zk data and then hdfs data 
on user acceptance. 
{code}
All ZNode(s) of regionservers are expired.
All ZNode(s) of backupmasters are expired.
Node does not exist: /hbase/master
Active Master ZNode also expired.

Do you want to clean zookeeper data.[y/n]y
13/04/04 20:23:34 DEBUG zookeeper.ZKConfig: Skipped reading ZK properties file 
'zoo.cfg' since 'hbase.config.read.zookeeper.config' was not set to true
Connecting to 10.18.91.14:2181
13/04/04 20:23:35 INFO zookeeper.ZooKeeper: Client 
environment:zookeeper.version=3.4.5-1392090, built on 09/30/2012 17:52 GMT
13/04/04 20:23:35 INFO zookeeper.ZooKeeper: Client 
environment:host.name=linux-129
13/04/04 20:23:35 INFO zookeeper.ZooKeeper: Client 
environment:java.version=1.6.0_31
13/04/04 20:23:35 INFO zookeeper.ZooKeeper: Client environment:java.vendor=Sun 
Microsystems Inc.
13/04/04 20:23:35 INFO zookeeper.ZooKeeper: Client 
environment:java.home=/opt/jdk1.6.0_31/jre
13/04/04 20:23:35 INFO zookeeper.ZooKeeper: Client 
environment:java.class.path=/home/rajeshbabu/hbase-0.97-SNAPSHOT/bin/../conf:
13/04/04 20:23:35 INFO zookeeper.ZooKeeper: Client 
environment:java.library.path=/opt/jdk1.6.0_31/jre/lib/amd64/server:/opt/jdk1.6.0_31/jre/lib/amd64:/opt/jdk1.6.0_31/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
13/04/04 20:23:35 INFO zookeeper.ZooKeeper: Client 
environment:java.io.tmpdir=/tmp
13/04/04 20:23:35 INFO zookeeper.ZooKeeper: Client 
environment:java.compiler=<NA>
13/04/04 20:23:35 INFO zookeeper.ZooKeeper: Client environment:os.name=Linux
13/04/04 20:23:35 INFO zookeeper.ZooKeeper: Client environment:os.arch=amd64
13/04/04 20:23:35 INFO zookeeper.ZooKeeper: Client 
environment:os.version=2.6.27.19-5-default
13/04/04 20:23:35 INFO zookeeper.ZooKeeper: Client environment:user.name=root
13/04/04 20:23:35 INFO zookeeper.ZooKeeper: Client environment:user.home=/root
13/04/04 20:23:35 INFO zookeeper.ZooKeeper: Client 
environment:user.dir=/home/rajeshbabu/hbase-0.97-SNAPSHOT/dev-support
13/04/04 20:23:35 INFO zookeeper.ZooKeeper: Initiating client connection, 
connectString=10.18.91.14:2181 sessionTimeout=30000 
watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@670655dd
13/04/04 20:23:35 INFO zookeeper.ClientCnxn: Opening socket connection to 
server linux-129/10.18.91.14:2181. Will not attempt to authenticate using SASL 
(Unable to locate a login configuration)
13/04/04 20:23:35 INFO zookeeper.ClientCnxn: Socket connection established to 
linux-129/10.18.91.14:2181, initiating session
13/04/04 20:23:35 INFO zookeeper.ClientCnxn: Session establishment complete on 
server linux-129/10.18.91.14:2181, sessionid = 0x13d821d941f00d5, negotiated 
timeout = 30000

WATCHER::

WatchedEvent state:SyncConnected type:None path:null
Do you want to clean hdfs data.[y/n]y
Deleted hdfs://10.18.91.14:9000/hbase

{code}

                
> Provide a command or argument to startup, that formats znodes if provided
> -------------------------------------------------------------------------
>
>                 Key: HBASE-7244
>                 URL: https://issues.apache.org/jira/browse/HBASE-7244
>             Project: HBase
>          Issue Type: New Feature
>          Components: Zookeeper
>    Affects Versions: 0.94.0
>            Reporter: Harsh J
>            Assignee: rajeshbabu
>            Priority: Minor
>             Fix For: 0.95.1, 0.98.0, 0.94.7
>
>         Attachments: HBASE-7244_2.patch, HBASE-7244_3.patch, HBASE-7244.patch
>
>
> Many a times I've had to, and have seen instructions being thrown, to stop 
> cluster, clear out ZK and restart.
> While this is only a quick (and painful to master) fix, it is certainly nifty 
> to some smaller cluster users but the process is far too long, roughly:
> 1. Stop HBase
> 2. Start zkCli.sh and connect to the right quorum
> 3. Find and ensure the HBase parent znode from the configs (/hbase only by 
> default)
> 4. Run an "rmr /hbase" in the zkCli.sh shell, or manually delete each znode 
> if on a lower version of ZK.
> 5. Quit zkCli.sh and start HBase again
> Perhaps it may be useful, if the start-hbase.sh itself accepted a formatZK 
> parameter. Such that, when you do a {{start-hbase.sh -formatZK}}, it does 
> steps 2-4 automatically for you.
> For safety, we could make the formatter code ensure that no HBase instance is 
> actually active, and skip the format process if it is. Similar to a HDFS 
> NameNode's format, which would disallow if the name directories are locked.
> Would this be a useful addition for administrators? Bigtop too can provide a 
> service subcommand that could do this.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to