Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D8952200C0D for ; Tue, 17 Jan 2017 02:08:38 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id D74F8160B4D; Tue, 17 Jan 2017 01:08:38 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0F15E160B41 for ; Tue, 17 Jan 2017 02:08:37 +0100 (CET) Received: (qmail 36937 invoked by uid 500); 17 Jan 2017 01:08:37 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 36928 invoked by uid 99); 17 Jan 2017 01:08:37 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jan 2017 01:08:37 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 19924DFBE6; Tue, 17 Jan 2017 01:08:37 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: smohanty@apache.org To: commits@ambari.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer 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 +0000 (UTC) archived-at: Tue, 17 Jan 2017 01:08:39 -0000 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 Authored: Mon Jan 16 17:04:11 2017 -0800 Committer: Sumit Mohanty 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,