Where is yarn.log.dir defined?

本秂侑毒 提交于 2019-12-22 09:47:13

问题


In yarn-default.xml for Apache Hadoop 3.0.0 it shows the default value for yarn.nodemanager.log-dirs as ${yarn.log.dir}/userlogs.

Where is yarn.log.dir defined? Does it have a default value?

I do not find it in any of the default configurations (core-default.xml, hdfs-default.xml, mapred-default.xml, yarn-default.xml).

I do not find it mentioned in any of the environment scripts (hadoop-env.sh,httpfs-env.sh,kms-env.sh,mapred-env.sh,yarn-env.sh.

Equally baffling to me is that when I grep the code for "yarn.nodemanager.log-dirs" the only places it shows up are in yarn-default.xml and markdown files, not in any java code anywhere. So how does setting yarn.nodemanager.log-dirs do anything?


回答1:


yarn.log.dir is a Java property, based by a -D flag

In the yarn-env.sh, you should see YARN_LOG_DIR

# default log directory and file
if [ "$YARN_LOG_DIR" = "" ]; then
  YARN_LOG_DIR="$HADOOP_YARN_HOME/logs"
  ...
fi

YARN_OPTS="$YARN_OPTS -Dyarn.log.dir=$YARN_LOG_DIR"


来源:https://stackoverflow.com/questions/48693607/where-is-yarn-log-dir-defined

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!