HBASE-11493 Autorestart option is not working because of stale znode 'shutdown'(Nijel)

This commit is contained in:
Rajeshbabu Chintaguntla 2014-07-14 05:32:55 +00:00
parent 1cedeae897
commit 5a05836dd1
1 changed files with 5 additions and 5 deletions

View File

@ -214,17 +214,17 @@ case $startStop in
#if the cluster is being stopped then do not restart it again. #if the cluster is being stopped then do not restart it again.
zparent=`$bin/hbase org.apache.hadoop.hbase.util.HBaseConfTool zookeeper.znode.parent` zparent=`$bin/hbase org.apache.hadoop.hbase.util.HBaseConfTool zookeeper.znode.parent`
if [ "$zparent" == "null" ]; then zparent="/hbase"; fi if [ "$zparent" == "null" ]; then zparent="/hbase"; fi
zshutdown=`$bin/hbase org.apache.hadoop.hbase.util.HBaseConfTool zookeeper.znode.state` zkrunning=`$bin/hbase org.apache.hadoop.hbase.util.HBaseConfTool zookeeper.znode.state`
if [ "$zshutdown" == "null" ]; then zshutdown="shutdown"; fi if [ "$zkrunning" == "null" ]; then zkrunning="running"; fi
zFullShutdown=$zparent/$zshutdown zkFullRunning=$zparent/$zkrunning
$bin/hbase zkcli stat $zFullShutdown 2>&1 | grep "Node does not exist" 1>/dev/null 2>&1 $bin/hbase zkcli stat $zkFullRunning 2>&1 | grep "Node does not exist" 1>/dev/null 2>&1
#grep returns 0 if it found something, 1 otherwise #grep returns 0 if it found something, 1 otherwise
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
exit 1 exit 1
fi fi
#If ZooKeeper cannot be found, then do not restart #If ZooKeeper cannot be found, then do not restart
$bin/hbase zkcli stat $zFullShutdown 2>&1 | grep Exception | grep ConnectionLoss 1>/dev/null 2>&1 $bin/hbase zkcli stat $zkFullRunning 2>&1 | grep Exception | grep ConnectionLoss 1>/dev/null 2>&1
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
exit 1 exit 1
fi fi