diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 480737bcc0..59773ae3e2 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -135,6 +135,9 @@ Trunk (Unreleased) HADOOP-11231. Remove dead code in ServletUtil. (Li Lu via wheat9) + HADOOP-11025. hadoop-daemons.sh should just call hdfs directly (Masatake + Iwasaki via aw) + BUG FIXES HADOOP-9451. Fault single-layer config if node group topology is enabled. diff --git a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-daemons.sh b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-daemons.sh index db06612691..20d7e4a26b 100755 --- a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-daemons.sh +++ b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-daemons.sh @@ -36,10 +36,10 @@ fi HADOOP_LIBEXEC_DIR="${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR}" # shellcheck disable=SC2034 HADOOP_NEW_CONFIG=true -if [[ -f "${HADOOP_LIBEXEC_DIR}/hadoop-config.sh" ]]; then - . "${HADOOP_LIBEXEC_DIR}/hadoop-config.sh" +if [[ -f "${HADOOP_LIBEXEC_DIR}/hdfs-config.sh" ]]; then + . "${HADOOP_LIBEXEC_DIR}/hdfs-config.sh" else - echo "ERROR: Cannot execute ${HADOOP_LIBEXEC_DIR}/hadoop-config.sh." 2>&1 + echo "ERROR: Cannot execute ${HADOOP_LIBEXEC_DIR}/hdfs-config.sh." 2>&1 exit 1 fi @@ -47,5 +47,14 @@ if [[ $# = 0 ]]; then hadoop_exit_with_usage 1 fi -hadoop_connect_to_hosts "${bin}/hadoop-daemon.sh" \ ---config "${HADOOP_CONF_DIR}" "$@" +daemonmode=$1 +shift + +if [[ -z "${HADOOP_HDFS_HOME}" ]]; then + hdfsscript="${HADOOP_PREFIX}/bin/hdfs" +else + hdfsscript="${HADOOP_HDFS_HOME}/bin/hdfs" +fi + +hadoop_connect_to_hosts "$hdfsscript" \ + --config "${HADOOP_CONF_DIR}" --daemon "${daemonmode}" "$@" diff --git a/hadoop-common-project/hadoop-common/src/main/conf/hadoop-env.sh b/hadoop-common-project/hadoop-common/src/main/conf/hadoop-env.sh index b0963af669..af8e54492e 100644 --- a/hadoop-common-project/hadoop-common/src/main/conf/hadoop-env.sh +++ b/hadoop-common-project/hadoop-common/src/main/conf/hadoop-env.sh @@ -175,7 +175,8 @@ esac # This sets the hadoop.root.logger property # export HADOOP_ROOT_LOGGER=INFO,console -# Default log level for daemons spawned explicitly by hadoop-daemon.sh +# Default log level for daemons spawned explicitly by +# --daemon option of hadoop, hdfs, mapred and yarn command. # This sets the hadoop.root.logger property # export HADOOP_DAEMON_ROOT_LOGGER=INFO,RFA