Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6C1DE116AC for ; Mon, 14 Jul 2014 05:33:22 +0000 (UTC) Received: (qmail 68305 invoked by uid 500); 14 Jul 2014 05:33:22 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 68260 invoked by uid 500); 14 Jul 2014 05:33:22 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 68250 invoked by uid 99); 14 Jul 2014 05:33:22 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jul 2014 05:33:22 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id C93BB8BD1EF; Mon, 14 Jul 2014 05:33:21 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: rajeshbabu@apache.org To: commits@hbase.apache.org Message-Id: <28db92a3017d4f9ba72ff48759ba16b6@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: HBASE-11493 Autorestart option is not working because of stale znode 'shutdown'(Nijel) Date: Mon, 14 Jul 2014 05:33:21 +0000 (UTC) Repository: hbase Updated Branches: refs/heads/master 1cedeae89 -> 5a05836dd HBASE-11493 Autorestart option is not working because of stale znode 'shutdown'(Nijel) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/5a05836d Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/5a05836d Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/5a05836d Branch: refs/heads/master Commit: 5a05836dd13deac020443a0d3e84cb7bcfde7552 Parents: 1cedeae Author: Rajeshbabu Chintaguntla Authored: Mon Jul 14 05:32:55 2014 +0000 Committer: Rajeshbabu Chintaguntla Committed: Mon Jul 14 05:32:55 2014 +0000 ---------------------------------------------------------------------- bin/hbase-daemon.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/5a05836d/bin/hbase-daemon.sh ---------------------------------------------------------------------- diff --git a/bin/hbase-daemon.sh b/bin/hbase-daemon.sh index caa74d8..649a171 100755 --- a/bin/hbase-daemon.sh +++ b/bin/hbase-daemon.sh @@ -214,17 +214,17 @@ case $startStop in #if the cluster is being stopped then do not restart it again. zparent=`$bin/hbase org.apache.hadoop.hbase.util.HBaseConfTool zookeeper.znode.parent` if [ "$zparent" == "null" ]; then zparent="/hbase"; fi - zshutdown=`$bin/hbase org.apache.hadoop.hbase.util.HBaseConfTool zookeeper.znode.state` - if [ "$zshutdown" == "null" ]; then zshutdown="shutdown"; fi - zFullShutdown=$zparent/$zshutdown - $bin/hbase zkcli stat $zFullShutdown 2>&1 | grep "Node does not exist" 1>/dev/null 2>&1 + zkrunning=`$bin/hbase org.apache.hadoop.hbase.util.HBaseConfTool zookeeper.znode.state` + if [ "$zkrunning" == "null" ]; then zkrunning="running"; fi + zkFullRunning=$zparent/$zkrunning + $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 if [ $? -eq 0 ]; then exit 1 fi #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 exit 1 fi