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 2014/03/04 20:28:16 UTC
git commit: AMBARI-4944. Logs do not give the full picture of steps
executed (aonishuk)
Repository: ambari
Updated Branches:
refs/heads/trunk 01e59101c -> 804cebf10
AMBARI-4944. Logs do not give the full picture of steps executed
(aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/804cebf1
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/804cebf1
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/804cebf1
Branch: refs/heads/trunk
Commit: 804cebf10096303ee3fce24cf15c5946c59377b0
Parents: 01e5910
Author: Andrew Onischuk <ao...@hortonworks.com>
Authored: Tue Mar 4 11:25:45 2014 -0800
Committer: Andrew Onischuk <ao...@hortonworks.com>
Committed: Tue Mar 4 11:28:03 2014 -0800
----------------------------------------------------------------------
ambari-agent/conf/unix/ambari-agent.ini | 2 ++
ambari-agent/src/main/python/ambari_agent/AmbariConfig.py | 2 ++
ambari-agent/src/main/python/ambari_agent/PythonExecutor.py | 7 +++++--
.../HDP/1.3.2/services/PIG/package/scripts/service_check.py | 3 +--
.../HDP/2.0.6/services/PIG/package/scripts/service_check.py | 3 +--
.../test/python/stacks/1.3.2/PIG/test_pig_service_check.py | 2 --
.../test/python/stacks/2.0.6/PIG/test_pig_service_check.py | 2 --
7 files changed, 11 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/804cebf1/ambari-agent/conf/unix/ambari-agent.ini
----------------------------------------------------------------------
diff --git a/ambari-agent/conf/unix/ambari-agent.ini b/ambari-agent/conf/unix/ambari-agent.ini
index 27eb6e1..daf15c0 100644
--- a/ambari-agent/conf/unix/ambari-agent.ini
+++ b/ambari-agent/conf/unix/ambari-agent.ini
@@ -54,3 +54,5 @@ dirs=/etc/hadoop,/etc/hadoop/conf,/etc/hbase,/etc/hcatalog,/etc/hive,/etc/oozie,
/var/log/nagios
rpms=nagios,ganglia,
hadoop,hadoop-lzo,hbase,oozie,sqoop,pig,zookeeper,hive,libconfuse,ambari-log4j
+; 0 - unlimited
+log_lines_count=300
http://git-wip-us.apache.org/repos/asf/ambari/blob/804cebf1/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py b/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
index 18e4c8a..79c7345 100644
--- a/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
+++ b/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
@@ -60,6 +60,8 @@ passphrase_env_var_name=AMBARI_PASSPHRASE
state_interval = 6
dirs=/etc/hadoop,/etc/hadoop/conf,/var/run/hadoop,/var/log/hadoop
rpms=glusterfs,openssl,wget,net-snmp,ntpd,ruby,ganglia,nagios,glusterfs
+log_lines_count=300
+
"""
s = StringIO.StringIO(content)
config.readfp(s)
http://git-wip-us.apache.org/repos/asf/ambari/blob/804cebf1/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py b/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py
index 8e3a87a..3b175a1 100644
--- a/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py
+++ b/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py
@@ -122,13 +122,16 @@ class PythonExecutor:
return python_command
def condenseOutput(self, stdout, stderr, retcode, structured_out):
+ log_lines_count = self.config.get('heartbeat', 'log_lines_count')
+
grep = self.grep
result = {
"exitcode": retcode,
- "stdout" : grep.tail(stdout, grep.OUTPUT_LAST_LINES),
- "stderr" : grep.tail(stderr, grep.OUTPUT_LAST_LINES),
+ "stdout": grep.tail(stdout, log_lines_count) if log_lines_count else stdout,
+ "stderr": grep.tail(stderr, log_lines_count) if log_lines_count else stderr,
"structuredOut" : structured_out
}
+
return result
def python_watchdog_func(self, python, timeout):
http://git-wip-us.apache.org/repos/asf/ambari/blob/804cebf1/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/PIG/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/PIG/package/scripts/service_check.py b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/PIG/package/scripts/service_check.py
index 5dd0935..9fd0657 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/PIG/package/scripts/service_check.py
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/PIG/package/scripts/service_check.py
@@ -55,8 +55,7 @@ class PigServiceCheck(Script):
tries = 3,
try_sleep = 5,
path = '/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
- user = params.smokeuser,
- logoutput = True
+ user = params.smokeuser
)
ExecuteHadoop( test_cmd,
http://git-wip-us.apache.org/repos/asf/ambari/blob/804cebf1/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/PIG/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/PIG/package/scripts/service_check.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/PIG/package/scripts/service_check.py
index 5dd0935..9fd0657 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/PIG/package/scripts/service_check.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/PIG/package/scripts/service_check.py
@@ -55,8 +55,7 @@ class PigServiceCheck(Script):
tries = 3,
try_sleep = 5,
path = '/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
- user = params.smokeuser,
- logoutput = True
+ user = params.smokeuser
)
ExecuteHadoop( test_cmd,
http://git-wip-us.apache.org/repos/asf/ambari/blob/804cebf1/ambari-server/src/test/python/stacks/1.3.2/PIG/test_pig_service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/1.3.2/PIG/test_pig_service_check.py b/ambari-server/src/test/python/stacks/1.3.2/PIG/test_pig_service_check.py
index 1b4e45e..67dcf74 100644
--- a/ambari-server/src/test/python/stacks/1.3.2/PIG/test_pig_service_check.py
+++ b/ambari-server/src/test/python/stacks/1.3.2/PIG/test_pig_service_check.py
@@ -45,7 +45,6 @@ class TestPigServiceCheck(RMFTestCase):
)
self.assertResourceCalled('Execute', 'pig /tmp/pigSmoke.sh',
- logoutput = True,
path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
tries = 3,
user = 'ambari-qa',
@@ -81,7 +80,6 @@ class TestPigServiceCheck(RMFTestCase):
)
self.assertResourceCalled('Execute', 'pig /tmp/pigSmoke.sh',
- logoutput = True,
path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
tries = 3,
user = 'ambari-qa',
http://git-wip-us.apache.org/repos/asf/ambari/blob/804cebf1/ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_service_check.py b/ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_service_check.py
index 0357926..1e1ad24 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_service_check.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_service_check.py
@@ -44,7 +44,6 @@ class TestPigServiceCheck(RMFTestCase):
)
self.assertResourceCalled('Execute', 'pig /tmp/pigSmoke.sh',
- logoutput = True,
path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
tries = 3,
user = 'ambari-qa',
@@ -80,7 +79,6 @@ class TestPigServiceCheck(RMFTestCase):
)
self.assertResourceCalled('Execute', 'pig /tmp/pigSmoke.sh',
- logoutput = True,
path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
tries = 3,
user = 'ambari-qa',