File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed
yarn/common/src/main/scala/org/apache/spark/deploy/yarn Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -344,6 +344,8 @@ trait ClientBase extends Logging {
344344 JAVA_OPTS += " " + env(" SPARK_JAVA_OPTS" )
345345 }
346346
347+ JAVA_OPTS += " " + YarnSparkHadoopUtil .getLoggingArgsForContainerCommandLine()
348+
347349 // Command for the ApplicationMaster
348350 val commands = List [String ](
349351 Environment .JAVA_HOME .$() + " /bin/java" +
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ trait ExecutorRunnableUtil extends Logging {
6262
6363 JAVA_OPTS += " -Djava.io.tmpdir=" +
6464 new Path (Environment .PWD .$(), YarnConfiguration .DEFAULT_CONTAINER_TEMP_DIR ) + " "
65+ JAVA_OPTS += YarnSparkHadoopUtil .getLoggingArgsForContainerCommandLine() + " "
6566
6667 // Commenting it out for now - so that people can refer to the properties if required. Remove
6768 // it once cpuset version is pushed out.
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import org.apache.hadoop.mapred.JobConf
2222import org .apache .hadoop .security .Credentials
2323import org .apache .hadoop .security .UserGroupInformation
2424import org .apache .hadoop .yarn .conf .YarnConfiguration
25+ import org .apache .hadoop .yarn .api .ApplicationConstants
2526import org .apache .hadoop .conf .Configuration
2627import org .apache .spark .deploy .SparkHadoopUtil
2728
@@ -67,3 +68,16 @@ class YarnSparkHadoopUtil extends SparkHadoopUtil {
6768 }
6869
6970}
71+
72+ object YarnSparkHadoopUtil {
73+ def getLoggingArgsForContainerCommandLine (): String = {
74+ " -Dlog4j.configuration=container-log4j.properties " +
75+ " -Dhadoop.root.logger=INFO,CLA " +
76+ // for yarn/stable:
77+ " -Dyarn.app.container.log.filesize=0 " +
78+ " -Dyarn.app.container.log.dir=" + ApplicationConstants .LOG_DIR_EXPANSION_VAR + " " +
79+ // for yarn/alpha:
80+ " -Dyarn.app.mapreduce.container.log.dir=" + ApplicationConstants .LOG_DIR_EXPANSION_VAR + " " +
81+ " -Dyarn.app.mapreduce.container.log.filesize=0"
82+ }
83+ }
You can’t perform that action at this time.
0 commit comments