You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2014/12/30 23:32:28 UTC

ambari git commit: AMBARI-8964. RU failed on Core Masters/ Restarting NAMENODE (ncole)

Repository: ambari
Updated Branches:
  refs/heads/trunk b768b9e95 -> 4e31964a7


AMBARI-8964. RU failed on Core Masters/ Restarting NAMENODE (ncole)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4e31964a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4e31964a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4e31964a

Branch: refs/heads/trunk
Commit: 4e31964a744a35187511458627eb99e8afda0b25
Parents: b768b9e
Author: Nate Cole <nc...@hortonworks.com>
Authored: Tue Dec 30 16:59:15 2014 -0500
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Tue Dec 30 17:01:30 2014 -0500

----------------------------------------------------------------------
 .../HDFS/2.1.0.2.0/package/scripts/utils.py      | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4e31964a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py
index 659233e..f185ea0 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py
@@ -73,11 +73,20 @@ def failover_namenode():
 
     # Wait until it transitions to standby
     check_standby_cmd = format("hdfs haadmin -getServiceState {namenode_id} | grep standby")
-    Execute(check_standby_cmd,
-            user=params.hdfs_user,
-            tries=30,
-            try_sleep=6,
-            logoutput=True)
+
+    # process may already be down.  try one time, then proceed
+    code, out = call(check_standby_cmd, user=params.hdfs_user, logoutput=True)
+    Logger.info(format("Rolling Upgrade - check for standby returned {code}"))
+
+    if code == 255 and out:
+      Logger.info("Rolling Upgrade - namenode is already down")
+    else:
+      Execute(check_standby_cmd,
+              user=params.hdfs_user,
+              tries=30,
+              try_sleep=6,
+              logoutput=True)
+
   else:
     Logger.info("Rolling Upgrade - Host %s is the standby namenode." % str(params.hostname))