hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kai Zheng (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HADOOP-9873) hadoop-env.sh got called multiple times
Date Wed, 14 Aug 2013 19:34:47 GMT
Kai Zheng created HADOOP-9873:

             Summary: hadoop-env.sh got called multiple times
                 Key: HADOOP-9873
                 URL: https://issues.apache.org/jira/browse/HADOOP-9873
             Project: Hadoop Common
          Issue Type: Bug
          Components: scripts
            Reporter: Kai Zheng
            Assignee: Kai Zheng
            Priority: Minor

Ref. below, it can be seen hadoop-env.sh got called multiple times when running something
like 'hadoop-daemon.sh start namenode'.
[drankye@zkdev ~]$ cd $HADOOP_PREFIX
[drankye@zkdev hadoop-3.0.0-SNAPSHOT]$ grep -r hadoop-env *
libexec/hadoop-config.sh:if [ -e "${HADOOP_PREFIX}/conf/hadoop-env.sh" ]; then
libexec/hadoop-config.sh:if [ -f "${HADOOP_CONF_DIR}/hadoop-env.sh" ]; then
libexec/hadoop-config.sh:  . "${HADOOP_CONF_DIR}/hadoop-env.sh"
sbin/hadoop-daemon.sh:if [ -f "${HADOOP_CONF_DIR}/hadoop-env.sh" ]; then
sbin/hadoop-daemon.sh:  . "${HADOOP_CONF_DIR}/hadoop-env.sh"

Considering the following lines in hadoop-env.sh
# Command specific options appended to HADOOP_OPTS when specified
-Dhdfs.audit.logger=${HDFS_AUDIT_LOGGER:-INFO,NullAppender} $HADOOP_NAMENODE_OPTS"
It may end with some redundant result like below when called multiple times.
HADOOP_NAMENODE_OPTS='-Dhadoop.security.logger=INFO,RFAS -Dhdfs.audit.logger=INFO,NullAppender
-Dhadoop.security.logger=INFO,RFAS -Dhdfs.audit.logger=INFO,NullAppender '

It's not a big issue for now however it would be better to be clean and avoid this since it
can cause the final JAVA command line is very lengthy and hard to read.

A possible fix would be to add a flag variable like HADOOP_ENV_INITED in hadoop-env.sh, and
then at the beginning of it check the flag. If the flag evaluates true, then return immediately.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message