-
Notifications
You must be signed in to change notification settings - Fork 8.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HDFS-17570 Respect Non-Default HADOOP_ROOT_LOGGER when HADOOP_DAEMON_ROOT_LOGGER is not specified in Daemon mode #6922
Open
VicoWu
wants to merge
3
commits into
apache:trunk
Choose a base branch
from
VicoWu:refine-daemon-root-log-level
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+12
−3
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
6a82029
to
83659c7
Compare
@aw-was-here @aajisaka Would you please take a look for this? |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
cf8ead0
to
0535f2d
Compare
💔 -1 overall
This message was automatically generated. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of PR
the
-Dhadoop.root.logger
will use the value ofHADOOP_ROOT_LOGGER
.In most cases, hadoop administrator tends to setup
HADOOP_ROOT_LOGGER
directly, it is effective in non-daemon mode and most hadoop administrator are not even aware of the existence ofHADOOP_DAEMON_ROOT_LOGGER
.So when he started up HADOOP as daemon mode, no matter how he set up
HADOOP_ROOT_LOGGER
, the-Dhadoop.root.logger
is not changed because in Daemon mode, theHADOOP_ROOT_LOGGER
is set up byHADOOP_DAEMON_ROOT_LOGGER
which is in fact a default value. The code is as below:This makes log setup and troubleshooting becomes very time consuming before we finally figure out the reason and the best practice without reading the code.
My change is:
In daemon mode
HADOOP_ROOT_LOGGER
but noHADOOP_DAEMON_ROOT_LOGGER
, then we will respectHADOOP_ROOT_LOGGER
as the final-Dhadoop.root.logger
value, instead of setting upHADOOP_ROOT_LOGGER
with the defaultHADOOP_DAEMON_ROOT_LOGGER
and print a warningHADOOP_DAEMON_ROOT_LOGGER
(no matter it is default or customized), we will setup theHADOOP_ROOT_LOGGER
with this customizedHADOOP_DAEMON_ROOT_LOGGER
How was this patch tested?
HADOOP_LOGLEVEL
HADOOP_LOGLEVEL
HADOOP_DAEMON_ROOT_LOGGER
in daemon modeHADOOP_DAEMON_ROOT_LOGGER
without customizingHADOOP_ROOT_LOGGER
HADOOP_DAEMON_ROOT_LOGGER
HADOOP_ROOT_LOGGER
but not customizeHADOOP_DAEMON_ROOT_LOGGER
HADOOP_ROOT_LOGGER
with a warningHADOOP_ROOT_LOGGER
andHADOOP_DAEMON_ROOT_LOGGER
HADOOP_DAEMON_ROOT_LOGGER
Customize the
HADOOP_LOGLEVEL
, should respect theHADOOP_LOGLEVEL
andHADOOP_DAEMON_ROOT_LOGGER
export HADOOP_LOGLEVEL=DEBUG
Without customizing anything, should respect default
HADOOP_DAEMON_ROOT_LOGGER
root@rccd101-6a:/home/hadoop/current-hadoop# ps -ef|grep NameNode hadoop 2855220 1 43 04:05 pts/1 00:00:07 /usr/lib/jvm/java-11-openjdk-amd64/bin/java -Dproc_namenode -Djava.net.preferIPv4Stack=true -Dhdfs.audit.logger=INFO,NullAppender -Dlog4j.configuration=file:/home/hadoop/current-hadoop/etc/hadoop/log4j-namenode.properties -XX:+UseG1GC -Xmx4096m -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=1029 -Dhadoop.security.logger=ERROR,RFAS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 -Dyarn.log.dir=/home/hadoop/hadoop-3.2.4/../logs -Dyarn.log.file=test-host-name.dev.corp.com.log -Dyarn.home.dir=/home/hadoop/hadoop-3.2.4 -Dyarn.root.logger=INFO,console -Djava.library.path=/home/hadoop/hadoop-3.2.4/lib/native -Dhadoop.log.dir=/home/hadoop/hadoop-3.2.4/../logs -Dhadoop.log.file=test-host-name.dev.corp.com.log -Dhadoop.home.dir=/home/hadoop/hadoop-3.2.4 -Dhadoop.id.str=hadoop -Dhadoop.root.logger=INFO,RFA -Dhadoop.policy.file=hadoop-policy.xml org.apache.hadoop.hdfs.server.namenode.NameNode
Customize the
HADOOP_DAEMON_ROOT_LOGGER
without customizingHADOOP_ROOT_LOGGER
, should respect customizedHADOOP_DAEMON_ROOT_LOGGER
export HADOOP_DAEMON_ROOT_LOGGER=TRACE,RFA
root@rccd101-6a:/home/hadoop/current-hadoop# ps -ef|grep NameNode hadoop 2857093 1 99 04:06 pts/1 00:00:07 /usr/lib/jvm/java-11-openjdk-amd64/bin/java -Dproc_namenode -Djava.net.preferIPv4Stack=true -Dhdfs.audit.logger=INFO,NullAppender -Dlog4j.configuration=file:/home/hadoop/current-hadoop/etc/hadoop/log4j-namenode.properties -XX:+UseG1GC -Xmx4096m -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=1029 -Dhadoop.security.logger=ERROR,RFAS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 -Dyarn.log.dir=/home/hadoop/hadoop-3.2.4/../logs -Dyarn.log.file=test-host-name.dev.corp.com.log -Dyarn.home.dir=/home/hadoop/hadoop-3.2.4 -Dyarn.root.logger=INFO,console -Djava.library.path=/home/hadoop/hadoop-3.2.4/lib/native -Dhadoop.log.dir=/home/hadoop/hadoop-3.2.4/../logs -Dhadoop.log.file=test-host-name.dev.corp.com.log -Dhadoop.home.dir=/home/hadoop/hadoop-3.2.4 -Dhadoop.id.str=hadoop -Dhadoop.root.logger=TRACE,RFA -Dhadoop.policy.file=hadoop-policy.xml org.apache.hadoop.hdfs.server.namenode.NameNode root 2857504 2745542 0 04:07 pts/1 00:00:00 grep --color=auto NameNode
Customize the
HADOOP_ROOT_LOGGER
but not customizeHADOOP_DAEMON_ROOT_LOGGER
, should respect customizedHADOOP_ROOT_LOGGER
with a warningexport HADOOP_ROOT_LOGGER=TRACE,console
root@rccd101-6a:/home/hadoop/current-hadoop# ps -ef|grep NameNode hadoop 2874729 1 99 04:16 pts/1 00:00:07 /usr/lib/jvm/java-11-openjdk-amd64/bin/java -Dproc_namenode -Djava.net.preferIPv4Stack=true -Dhdfs.audit.logger=INFO,NullAppender -Dlog4j.configuration=file:/home/hadoop/current-hadoop/etc/hadoop/log4j-namenode.properties -XX:+UseG1GC -Xmx4096m -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=1029 -Dhadoop.security.logger=ERROR,RFAS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 -Dyarn.log.dir=/home/hadoop/hadoop-3.2.4/../logs -Dyarn.log.file=test-host-name.dev.corp.com.log -Dyarn.home.dir=/home/hadoop/hadoop-3.2.4 -Dyarn.root.logger=INFO,console -Djava.library.path=/home/hadoop/hadoop-3.2.4/lib/native -Dhadoop.log.dir=/home/hadoop/hadoop-3.2.4/../logs -Dhadoop.log.file=test-host-name.dev.corp.com.log -Dhadoop.home.dir=/home/hadoop/hadoop-3.2.4 -Dhadoop.id.str=hadoop -Dhadoop.root.logger=TRACE,console -Dhadoop.policy.file=hadoop-policy.xml org.apache.hadoop.hdfs.server.namenode.NameNode
Customize both
HADOOP_ROOT_LOGGER
andHADOOP_DAEMON_ROOT_LOGGER
, should respect customizedHADOOP_DAEMON_ROOT_LOGGER
root@rccd101-6a:/home/hadoop/current-hadoop# ps -ef|grep NameNode hadoop 2877521 1 61 04:18 pts/1 00:00:07 /usr/lib/jvm/java-11-openjdk-amd64/bin/java -Dproc_namenode -Djava.net.preferIPv4Stack=true -Dhdfs.audit.logger=INFO,NullAppender -Dlog4j.configuration=file:/home/hadoop/current-hadoop/etc/hadoop/log4j-namenode.properties -XX:+UseG1GC -Xmx4096m -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=1029 -Dhadoop.security.logger=ERROR,RFAS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 -Dyarn.log.dir=/home/hadoop/hadoop-3.2.4/../logs -Dyarn.log.file=test-host-name.dev.corp.com.log -Dyarn.home.dir=/home/hadoop/hadoop-3.2.4 -Dyarn.root.logger=INFO,console -Djava.library.path=/home/hadoop/hadoop-3.2.4/lib/native -Dhadoop.log.dir=/home/hadoop/hadoop-3.2.4/../logs -Dhadoop.log.file=test-host-name.dev.corp.com.log -Dhadoop.home.dir=/home/hadoop/hadoop-3.2.4 -Dhadoop.id.str=hadoop -Dhadoop.root.logger=TRACE,RFA -Dhadoop.policy.file=hadoop-policy.xml org.apache.hadoop.hdfs.server.namenode.NameNode
For code changes:
LICENSE
,LICENSE-binary
,NOTICE-binary
files?