ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smoha...@apache.org
Subject ambari git commit: Revert "Revert "AMBARI-19559. Log Namenode formatting output into ambari-agent command logs. (stoader)""
Date Tue, 17 Jan 2017 01:08:37 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 0d5576f2d -> ef869d324


Revert "Revert "AMBARI-19559. Log Namenode formatting output into ambari-agent command logs.
(stoader)""

This reverts commit ea4051ab4205e0d68c45ffcbc0651fff7faa0d6c.


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

Branch: refs/heads/branch-2.5
Commit: ef869d324e6fa6bfb7b87c671929bceee5e2d627
Parents: 0d5576f
Author: Sumit Mohanty <smohanty@hortonworks.com>
Authored: Mon Jan 16 17:04:11 2017 -0800
Committer: Sumit Mohanty <smohanty@hortonworks.com>
Committed: Mon Jan 16 17:04:11 2017 -0800

----------------------------------------------------------------------
 .../HDFS/2.1.0.2.0/package/scripts/hdfs_namenode.py   | 14 +++++++++-----
 .../services/HDFS/package/scripts/hdfs_namenode.py    |  3 ++-
 .../test/python/stacks/2.0.6/HDFS/test_namenode.py    |  4 ++++
 3 files changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ef869d32/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_namenode.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_namenode.py
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_namenode.py
index cc03bb3..a2edf38 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_namenode.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_namenode.py
@@ -254,7 +254,7 @@ def namenode(action=None, hdfs_binary=None, do_format=True, upgrade_type=None,
     namenode_format_marker = os.path.join(params.hadoop_conf_dir,"NN_FORMATTED")
     if not os.path.exists(namenode_format_marker):
       hadoop_cmd = "cmd /C %s" % (os.path.join(params.hadoop_home, "bin", "hadoop.cmd"))
-      Execute("%s namenode -format" % (hadoop_cmd))
+      Execute("%s namenode -format" % (hadoop_cmd), logoutput=True)
       open(namenode_format_marker, 'a').close()
     Service(params.namenode_win_service_name, action=action)
   elif action == "stop":
@@ -311,12 +311,14 @@ def format_namenode(force=None):
     if force:
       ExecuteHadoop('namenode -format',
                     bin_dir=params.hadoop_bin_dir,
-                    conf_dir=hadoop_conf_dir)
+                    conf_dir=hadoop_conf_dir,
+                    logoutput=True)
     else:
       if not is_namenode_formatted(params):
         Execute(format("hdfs --config {hadoop_conf_dir} namenode -format -nonInteractive"),
                 user = params.hdfs_user,
-                path = [params.hadoop_bin_dir]
+                path = [params.hadoop_bin_dir],
+                logoutput=True
         )
         for m_dir in mark_dir:
           Directory(m_dir,
@@ -330,14 +332,16 @@ def format_namenode(force=None):
       if force:
         ExecuteHadoop('namenode -format',
                       bin_dir=params.hadoop_bin_dir,
-                      conf_dir=hadoop_conf_dir)
+                      conf_dir=hadoop_conf_dir,
+                      logoutput=True)
       else:
         nn_name_dirs = params.dfs_name_dir.split(',')
         if not is_namenode_formatted(params):
           try:
             Execute(format("hdfs --config {hadoop_conf_dir} namenode -format -nonInteractive"),
                     user = params.hdfs_user,
-                    path = [params.hadoop_bin_dir]
+                    path = [params.hadoop_bin_dir],
+                    logoutput=True
             )
           except Fail:
             # We need to clean-up mark directories, so we can re-run format next time.

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef869d32/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/package/scripts/hdfs_namenode.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/package/scripts/hdfs_namenode.py
b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/package/scripts/hdfs_namenode.py
index 35e16d5..6de7735 100644
--- a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/package/scripts/hdfs_namenode.py
+++ b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/package/scripts/hdfs_namenode.py
@@ -112,7 +112,8 @@ def format_namenode(force=None):
       ExecuteHadoop('namenode -format',
                     kinit_override=True,
                     bin_dir=params.hadoop_bin_dir,
-                    conf_dir=hadoop_conf_dir)
+                    conf_dir=hadoop_conf_dir,
+                    logoutput=True)
     else:
       File(format("{tmp_dir}/checkForFormat.sh"),
            content=StaticFile("checkForFormat.sh"),

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef869d32/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
index 255abc6..fae500f 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
@@ -65,6 +65,7 @@ class TestNamenode(RMFTestCase):
     self.assertResourceCalled('Execute', 'hdfs --config /etc/hadoop/conf namenode -format
-nonInteractive',
                               path = ['/usr/bin'],
                               user = 'hdfs',
+                              logoutput = True,
                               )
     self.assertResourceCalled('Directory', '/hadoop/hdfs/namenode/namenode-formatted/',
                               create_parents = True,
@@ -181,6 +182,7 @@ class TestNamenode(RMFTestCase):
     self.assertResourceCalled('Execute', 'hdfs --config /etc/hadoop/conf namenode -format
-nonInteractive',
         path = ['/usr/bin'],
         user = 'hdfs',
+        logoutput = True,
     )
     self.assertResourceCalled('Directory', '/hadoop/hdfs/namenode/namenode-formatted/',
         create_parents = True,
@@ -310,6 +312,7 @@ class TestNamenode(RMFTestCase):
     self.assertResourceCalled('Execute', 'hdfs --config /etc/hadoop/conf namenode -format
-nonInteractive',
         path = ['/usr/bin'],
         user = 'hdfs',
+        logoutput = True,
     )
     self.assertResourceCalled('Directory', '/hadoop/hdfs/namenode/namenode-formatted/',
         create_parents = True,
@@ -736,6 +739,7 @@ class TestNamenode(RMFTestCase):
     self.assertResourceCalled('Execute', 'hdfs --config /etc/hadoop/conf namenode -format
-nonInteractive',
         path = ['/usr/bin'],
         user = 'hdfs',
+        logoutput = True,
     )
     self.assertResourceCalled('Directory', '/hadoop/hdfs/namenode/namenode-formatted/',
         create_parents = True,


Mime
View raw message