You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2015/06/29 13:30:37 UTC

[2/2] ambari git commit: AMBARI-12199. With non-root agent RU restart NN fails (aonishuk)

AMBARI-12199. With non-root agent RU restart NN fails (aonishuk)


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

Branch: refs/heads/branch-2.1
Commit: 630e160d352209aca7b66dcefa4de8afc55b6de3
Parents: 8868dbc
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Mon Jun 29 14:30:30 2015 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Mon Jun 29 14:30:30 2015 +0300

----------------------------------------------------------------------
 .../HDFS/2.1.0.2.0/package/scripts/utils.py             | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/630e160d/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 263bdec..2360d7a 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
@@ -114,13 +114,17 @@ def kill_zkfc(zkfc_user):
   if params.dfs_ha_enabled:
     zkfc_pid_file = get_service_pid_file("zkfc", zkfc_user)
     if zkfc_pid_file:
-      check_process = as_user(format("ls {zkfc_pid_file} > /dev/null 2>&1 && ps -p `cat {zkfc_pid_file}` > /dev/null 2>&1"), user=params.hdfs_user)
+      check_process = as_user(format("ls {zkfc_pid_file} > /dev/null 2>&1 && ps -p `cat {zkfc_pid_file}` > /dev/null 2>&1"), user=zkfc_user)
       code, out = shell.call(check_process)
       if code == 0:
         Logger.debug("ZKFC is running and will be killed to initiate namenode failover.")
-        kill_command = format("{check_process} && kill -9 `cat {zkfc_pid_file}` > /dev/null 2>&1")
-        Execute(kill_command)
-        Execute(format("rm -f {zkfc_pid_file}"))
+        kill_command = format("kill -9 `cat {zkfc_pid_file}`")
+        Execute(kill_command,
+             user=zkfc_user
+        )
+        File(zkfc_pid_file,
+             action = "delete",
+        )
         return True
   return False