|
@@ -37,11 +37,15 @@ while [ -h "$this" ]; do
|
|
done
|
|
done
|
|
|
|
|
|
# the root of the Hadoop installation
|
|
# the root of the Hadoop installation
|
|
-root=`dirname $this`/..
|
|
|
|
|
|
+HADOOP_HOME=`dirname $this`/..
|
|
|
|
+
|
|
|
|
+if [ -f "$HADOOP_HOME/conf/hadoop-env.sh" ]; then
|
|
|
|
+ source ${HADOOP_HOME}/conf/hadoop-env.sh
|
|
|
|
+fi
|
|
|
|
|
|
# get log directory
|
|
# get log directory
|
|
if [ "$HADOOP_LOG_DIR" = "" ]; then
|
|
if [ "$HADOOP_LOG_DIR" = "" ]; then
|
|
- HADOOP_LOG_DIR=$root/logs
|
|
|
|
|
|
+ HADOOP_LOG_DIR=$HADOOP_HOME/logs
|
|
mkdir -p $HADOOP_LOG_DIR
|
|
mkdir -p $HADOOP_LOG_DIR
|
|
fi
|
|
fi
|
|
|
|
|
|
@@ -70,10 +74,10 @@ case $startStop in
|
|
|
|
|
|
if [ "$HADOOP_MASTER" != "" ]; then
|
|
if [ "$HADOOP_MASTER" != "" ]; then
|
|
echo rsync from $HADOOP_MASTER
|
|
echo rsync from $HADOOP_MASTER
|
|
- rsync -a --delete --exclude=.svn $HADOOP_MASTER/ $root
|
|
|
|
|
|
+ rsync -a --delete --exclude=.svn $HADOOP_MASTER/ $HADOOP_HOME
|
|
fi
|
|
fi
|
|
|
|
|
|
- cd $root
|
|
|
|
|
|
+ cd $HADOOP_HOME
|
|
echo starting $command, logging to $log
|
|
echo starting $command, logging to $log
|
|
nohup bin/hadoop $command "$@" >& $log < /dev/null &
|
|
nohup bin/hadoop $command "$@" >& $log < /dev/null &
|
|
echo $! > $pid
|
|
echo $! > $pid
|