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 2017/01/05 00:05:11 UTC

[30/50] [abbrv] ambari git commit: AMBARI-19343. Add log rotation settings to Oozie (Madhuvanthi Radhakrishnan via smohanty)

AMBARI-19343. Add log rotation settings to Oozie (Madhuvanthi Radhakrishnan via smohanty)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: dde269491ab0ddadc9fa77f88e62ac91a8b8b676
Parents: 702b92a
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Tue Jan 3 10:38:32 2017 -0800
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Tue Jan 3 10:39:09 2017 -0800

----------------------------------------------------------------------
 .../OOZIE/4.0.0.2.0/configuration/oozie-log4j.xml      | 13 ++++++++++++-
 .../OOZIE/4.0.0.2.0/package/scripts/oozie.py           |  2 +-
 .../OOZIE/4.0.0.2.0/package/scripts/params_linux.py    |  1 +
 .../OOZIE/4.2.0.2.3/configuration/oozie-log4j.xml      | 13 ++++++++++++-
 .../python/stacks/2.0.6/OOZIE/test_oozie_client.py     |  6 +++---
 .../python/stacks/2.0.6/OOZIE/test_oozie_server.py     |  8 ++++----
 6 files changed, 33 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/dde26949/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/configuration/oozie-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/configuration/oozie-log4j.xml b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/configuration/oozie-log4j.xml
index f2c3c81..ff1e388 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/configuration/oozie-log4j.xml
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/configuration/oozie-log4j.xml
@@ -21,6 +21,17 @@
 -->
 <configuration supports_final="false" supports_adding_forbidden="true">
   <property>
+    <name>oozie_log_maxhistory</name>
+    <value>720</value>
+    <description>The number of hours for which log files will be retained</description>
+    <display-name>Oozie Log: # Hours of Log Rentention</display-name>
+    <value-attributes>
+      <type>int</type>
+      <minimum>0</minimum>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+  <property>
     <name>content</name>
     <display-name>oozie-log4j template</display-name>
     <description>Custom log4j.properties</description>
@@ -60,7 +71,7 @@ log4j.appender.oozie.layout.ConversionPattern=%d{ISO8601} %5p %c{1}:%L - SERVER[
 # value of log4j.appender.oozie.File
 log4j.appender.oozie.RollingPolicy.FileNamePattern=${log4j.appender.oozie.File}-%d{yyyy-MM-dd-HH}
 # The MaxHistory controls how many log files will be retained (720 hours / 24 hours per day = 30 days); -1 to disable
-log4j.appender.oozie.RollingPolicy.MaxHistory=720
+log4j.appender.oozie.RollingPolicy.MaxHistory={{oozie_log_maxhistory}}
 
 # Uncomment the below two lines to use the DailyRollingFileAppender instead
 # The DatePattern must end with either "dd" or "HH"

http://git-wip-us.apache.org/repos/asf/ambari/blob/dde26949/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
index 8994128..14a0b23 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
@@ -148,7 +148,7 @@ def oozie(is_server=False):
       mode=0644,
       group=params.user_group,
       owner=params.oozie_user,
-      content=params.log4j_props
+      content=InlineTemplate(params.log4j_props)
     )
   elif (os.path.exists(format("{params.conf_dir}/oozie-log4j.properties"))):
     File(format("{params.conf_dir}/oozie-log4j.properties"),

http://git-wip-us.apache.org/repos/asf/ambari/blob/dde26949/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py
index dd4e373..4cdd280 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py
@@ -289,6 +289,7 @@ has_falcon_host = not len(falcon_host)  == 0
 oozie_server_hostnames = default("/clusterHostInfo/oozie_server", [])
 oozie_server_hostnames = sorted(oozie_server_hostnames)
 
+oozie_log_maxhistory = default('configurations/oozie-log4j/oozie_log_maxhistory',720)
 
 #oozie-log4j.properties
 if (('oozie-log4j' in config['configurations']) and ('content' in config['configurations']['oozie-log4j'])):

http://git-wip-us.apache.org/repos/asf/ambari/blob/dde26949/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.2.3/configuration/oozie-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.2.3/configuration/oozie-log4j.xml b/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.2.3/configuration/oozie-log4j.xml
index 2891252..123d570 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.2.3/configuration/oozie-log4j.xml
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.2.3/configuration/oozie-log4j.xml
@@ -20,6 +20,17 @@
  */
 -->
 <configuration supports_final="false" supports_adding_forbidden="true">
+   <property>
+    <name>oozie_log_maxhistory</name>
+    <value>720</value>
+    <description>The number of hours for which log files will be retained</description>
+    <display-name>Oozie Log: # Hours of Log Rentention</display-name>
+    <value-attributes>
+      <type>int</type>
+      <minimum>0</minimum>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
   <property>
     <name>content</name>
     <display-name>oozie-log4j template</display-name>
@@ -60,7 +71,7 @@ log4j.appender.oozie.layout.ConversionPattern=%d{ISO8601} %5p %c{1}:%L - SERVER[
 # value of log4j.appender.oozie.File
 log4j.appender.oozie.RollingPolicy.FileNamePattern=${log4j.appender.oozie.File}-%d{yyyy-MM-dd-HH}
 # The MaxHistory controls how many log files will be retained (720 hours / 24 hours per day = 30 days); -1 to disable
-log4j.appender.oozie.RollingPolicy.MaxHistory=720
+log4j.appender.oozie.RollingPolicy.MaxHistory={{oozie_log_maxhistory}}
 
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/dde26949/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_client.py b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_client.py
index 70fcb3f..f7e4410 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_client.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_client.py
@@ -69,7 +69,7 @@ class TestOozieClient(RMFTestCase):
                               owner = 'oozie',
                               group = 'hadoop',
                               mode = 0644,
-                              content = 'log4jproperties\nline2'
+                              content = InlineTemplate('log4jproperties\nline2')
                               )
     self.assertResourceCalled('File', '/etc/oozie/conf/adminusers.txt',
         owner = 'oozie',
@@ -135,7 +135,7 @@ class TestOozieClient(RMFTestCase):
                               owner = 'oozie',
                               group = 'hadoop',
                               mode = 0644,
-                              content = 'log4jproperties\nline2'
+                              content = InlineTemplate('log4jproperties\nline2')
                               )
     self.assertResourceCalled('File', '/etc/oozie/conf/adminusers.txt',
                               owner = 'oozie',
@@ -207,7 +207,7 @@ class TestOozieClient(RMFTestCase):
                               owner = 'oozie',
                               group = 'hadoop',
                               mode = 0644,
-                              content = 'log4jproperties\nline2'
+                              content = InlineTemplate('log4jproperties\nline2')
     )
     self.assertResourceCalled('File', '/usr/hdp/current/oozie-client/conf/adminusers.txt',
                               content = Template('adminusers.txt.j2'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/dde26949/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
index bfa6d45..d24d0b9 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
@@ -125,7 +125,7 @@ class TestOozieServer(RMFTestCase):
                               content=Template("oozie.conf.j2"),
                               )
     self.assertResourceCalled('File', '/etc/oozie/conf/oozie-log4j.properties',
-                              content = 'log4jproperties\nline2',
+                              content = InlineTemplate('log4jproperties\nline2'),
                               owner = 'oozie',
                               group = 'hadoop',
                               mode = 0644,
@@ -353,7 +353,7 @@ class TestOozieServer(RMFTestCase):
                               content=Template("oozie.conf.j2"),
                               )
     self.assertResourceCalled('File', '/etc/oozie/conf/oozie-log4j.properties',
-                              content = 'log4jproperties\nline2',
+                              content = InlineTemplate('log4jproperties\nline2'),
                               owner = 'oozie',
                               group = 'hadoop',
                               mode = 0644,
@@ -793,7 +793,7 @@ class TestOozieServer(RMFTestCase):
                               owner = 'oozie',
                               group = 'hadoop',
                               mode = 0644,
-                              content = 'log4jproperties\nline2'
+                              content = InlineTemplate('log4jproperties\nline2')
                               )
     self.assertResourceCalled('File', '/etc/oozie/conf/adminusers.txt',
                               owner = 'oozie',
@@ -992,7 +992,7 @@ class TestOozieServer(RMFTestCase):
                               owner = 'oozie',
                               group = 'hadoop',
                               mode = 0644,
-                              content = 'log4jproperties\nline2'
+                              content = InlineTemplate('log4jproperties\nline2')
                               )
     self.assertResourceCalled('File', '/etc/oozie/conf/adminusers.txt',
                               owner = 'oozie',