diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 1e0976bf9f..897739a4fa 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -230,6 +230,9 @@ Release 0.23.1 - Unreleased MAPREDUCE-3479. JobClient#getJob cannot find local jobs. (tomwhite) + MAPREDUCE-3456. $HADOOP_PREFIX/bin/yarn should set defaults for + $HADOOP_*_HOME (Eric Payne via mahadev) + Release 0.23.0 - 2011-11-01 INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-yarn/bin/yarn b/hadoop-mapreduce-project/hadoop-yarn/bin/yarn index b11c94b37e..b8e23a97f5 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/bin/yarn +++ b/hadoop-mapreduce-project/hadoop-yarn/bin/yarn @@ -148,9 +148,13 @@ IFS= # add hadoop-common libs to CLASSPATH if [ ! -d "$HADOOP_COMMON_HOME" ]; then - echo No HADOOP_COMMON_HOME set. - echo Please specify it either in yarn-env.sh or in the environment. - exit 1 + if [ -d "$HADOOP_PREFIX" ]; then + export HADOOP_COMMON_HOME=$HADOOP_PREFIX + else + echo No HADOOP_COMMON_HOME set. + echo Please specify it either in yarn-env.sh or in the environment. + exit 1 + fi fi CLASSPATH=${CLASSPATH}:$HADOOP_COMMON_HOME/share/hadoop/common'/*' @@ -158,9 +162,13 @@ CLASSPATH=${CLASSPATH}:$HADOOP_COMMON_HOME/share/hadoop/common/lib'/*' # add hadoop-hdfs libs to CLASSPATH if [ ! -d "$HADOOP_HDFS_HOME" ]; then - echo No HADOOP_HDFS_HOME set. - echo Please specify it either in yarn-env.sh or in the environment. - exit 1 + if [ -d "$HADOOP_PREFIX" ]; then + export HADOOP_HDFS_HOME=$HADOOP_PREFIX + else + echo No HADOOP_HDFS_HOME set. + echo Please specify it either in yarn-env.sh or in the environment. + exit 1 + fi fi CLASSPATH=${CLASSPATH}:$HADOOP_HDFS_HOME/share/hadoop/hdfs'/*' CLASSPATH=${CLASSPATH}:$HADOOP_HDFS_HOME/share/hadoop/hdfs/lib'/*'