Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 fe828aef7 -> e1f7795ba


AMBARI-19193. Add common log rotation settings to YARN Configs (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/e1f7795b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e1f7795b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e1f7795b

Branch: refs/heads/branch-2.5
Commit: e1f7795ba1e64945c539b0c5639bbbddb4c123a5
Parents: fe828ae
Author: Sumit Mohanty <[email protected]>
Authored: Wed Dec 14 08:46:30 2016 -0800
Committer: Sumit Mohanty <[email protected]>
Committed: Wed Dec 14 08:46:36 2016 -0800

----------------------------------------------------------------------
 .../2.0.6/hooks/before-START/scripts/params.py  |  4 ++++
 .../services/YARN/configuration/yarn-log4j.xml  | 25 ++++++++++++++++++--
 2 files changed, 27 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e1f7795b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py
index 4a5ee25..daba3d3 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py
@@ -208,6 +208,10 @@ yarn_log_dir_prefix = 
default("/configurations/yarn-env/yarn_log_dir_prefix","/v
 
 dfs_hosts = default('/configurations/hdfs-site/dfs.hosts', None)
 
+# Yarn log4j settings
+yarn_rm_summary_log_max_backup_size = 
default('configurations/yarn-log4j/yarn_rm_summary_log_max_backup_size', 256)
+yarn_rm_summary_log_number_of_backup_files = 
default('configurations/yarn-log4j/yarn_rm_summary_log_number_of_backup_files', 
20)
+
 #log4j.properties
 if (('hdfs-log4j' in config['configurations']) and ('content' in 
config['configurations']['hdfs-log4j'])):
   log4j_props = config['configurations']['hdfs-log4j']['content']

http://git-wip-us.apache.org/repos/asf/ambari/blob/e1f7795b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/yarn-log4j.xml
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/yarn-log4j.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/yarn-log4j.xml
index 9ac34f3..84c6db1 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/yarn-log4j.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/yarn-log4j.xml
@@ -21,6 +21,27 @@
 -->
 <configuration supports_final="false" supports_adding_forbidden="true">
   <property>
+    <name>yarn_rm_summary_log_max_backup_size</name>
+    <value>256</value>
+    <description>The maximum size of backup file before the log is 
rotated</description>
+    <display-name>Yarn Log: rmsummary backup file size</display-name>
+    <value-attributes>
+        <unit>MB</unit>
+    </value-attributes>
+     <on-ambari-upgrade add="true"/>
+   </property>
+   <property>
+      <name>yarn_rm_summary_log_number_of_backup_files</name>
+      <value>20</value>
+      <description>The number of backup files</description>
+      <display-name>Yarn Log: # of backup files</display-name>
+    <value-attributes>
+        <type>int</type>
+        <minimum>0</minimum>
+    </value-attributes>
+    <on-ambari-upgrade add="true"/>
+    </property>
+  <property>
     <name>content</name>
     <display-name>yarn-log4j template</display-name>
     <description>Custom log4j.properties</description>
@@ -54,8 +75,8 @@ 
yarn.server.resourcemanager.appsummary.logger=${hadoop.root.logger}
 #    - yarn.server.resourcemanager.appsummary.logger (resource manager app 
summary log level and appender)
 log4j.appender.RMSUMMARY=org.apache.log4j.RollingFileAppender
 
log4j.appender.RMSUMMARY.File=${yarn.log.dir}/${yarn.server.resourcemanager.appsummary.log.file}
-log4j.appender.RMSUMMARY.MaxFileSize=256MB
-log4j.appender.RMSUMMARY.MaxBackupIndex=20
+log4j.appender.RMSUMMARY.MaxFileSize={{yarn_rm_summary_log_max_backup_size}}MB
+log4j.appender.RMSUMMARY.MaxBackupIndex={{yarn_rm_summary_log_number_of_backup_files}}
 log4j.appender.RMSUMMARY.layout=org.apache.log4j.PatternLayout
 log4j.appender.RMSUMMARY.layout.ConversionPattern=%d{ISO8601} %p %c{2}: %m%n
 log4j.appender.JSA.layout=org.apache.log4j.PatternLayout

Reply via email to