hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r378078 - in /lucene/hadoop/trunk: ./ bin/hadoop bin/hadoop-daemon.sh bin/slaves.sh conf/ conf/hadoop-env.sh.template conf/slaves.template
Date Wed, 15 Feb 2006 19:53:53 GMT
Author: cutting
Date: Wed Feb 15 11:53:52 2006
New Revision: 378078

URL: http://svn.apache.org/viewcvs?rev=378078&view=rev
Log:
Fix HADOOP-36.  Scripts now source conf/hadoop-env.sh, to faciliate setting of environment
variables, even on remote hosts.  The default slaves file has move from ~/.slaves to conf/slaves.

Added:
    lucene/hadoop/trunk/conf/hadoop-env.sh.template
    lucene/hadoop/trunk/conf/slaves.template
Modified:
    lucene/hadoop/trunk/   (props changed)
    lucene/hadoop/trunk/bin/hadoop
    lucene/hadoop/trunk/bin/hadoop-daemon.sh
    lucene/hadoop/trunk/bin/slaves.sh
    lucene/hadoop/trunk/conf/   (props changed)

Propchange: lucene/hadoop/trunk/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Feb 15 11:53:52 2006
@@ -1,3 +1,2 @@
 build
 logs
-

Modified: lucene/hadoop/trunk/bin/hadoop
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/bin/hadoop?rev=378078&r1=378077&r2=378078&view=diff
==============================================================================
--- lucene/hadoop/trunk/bin/hadoop (original)
+++ lucene/hadoop/trunk/bin/hadoop Wed Feb 15 11:53:52 2006
@@ -49,6 +49,10 @@
 THIS_DIR=`dirname "$THIS"`
 HADOOP_HOME=`cd "$THIS_DIR/.." ; pwd`
 
+if [ -f "$HADOOP_HOME/conf/hadoop-env.sh" ]; then
+  source ${HADOOP_HOME}/conf/hadoop-env.sh
+fi
+
 # some Java parameters
 if [ "$JAVA_HOME" != "" ]; then
   #echo "run java in $JAVA_HOME"

Modified: lucene/hadoop/trunk/bin/hadoop-daemon.sh
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/bin/hadoop-daemon.sh?rev=378078&r1=378077&r2=378078&view=diff
==============================================================================
--- lucene/hadoop/trunk/bin/hadoop-daemon.sh (original)
+++ lucene/hadoop/trunk/bin/hadoop-daemon.sh Wed Feb 15 11:53:52 2006
@@ -37,11 +37,15 @@
 done
 
 # 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
 if [ "$HADOOP_LOG_DIR" = "" ]; then
-  HADOOP_LOG_DIR=$root/logs
+  HADOOP_LOG_DIR=$HADOOP_HOME/logs
   mkdir -p $HADOOP_LOG_DIR
 fi
 
@@ -70,10 +74,10 @@
 
     if [ "$HADOOP_MASTER" != "" ]; then
       echo rsync from $HADOOP_MASTER
-      rsync -a --delete --exclude=.svn $HADOOP_MASTER/ $root
+      rsync -a --delete --exclude=.svn $HADOOP_MASTER/ $HADOOP_HOME
     fi
 
-    cd $root
+    cd $HADOOP_HOME
     echo starting $command, logging to $log
     nohup bin/hadoop $command "$@" >& $log < /dev/null &
     echo $! > $pid

Modified: lucene/hadoop/trunk/bin/slaves.sh
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/bin/slaves.sh?rev=378078&r1=378077&r2=378078&view=diff
==============================================================================
--- lucene/hadoop/trunk/bin/slaves.sh (original)
+++ lucene/hadoop/trunk/bin/slaves.sh Wed Feb 15 11:53:52 2006
@@ -15,8 +15,27 @@
   exit 1
 fi
 
+# resolve links - $0 may be a softlink
+this="$0"
+while [ -h "$this" ]; do
+  ls=`ls -ld "$this"`
+  link=`expr "$ls" : '.*-> \(.*\)$'`
+  if expr "$link" : '.*/.*' > /dev/null; then
+    this="$link"
+  else
+    this=`dirname "$this"`/"$link"
+  fi
+done
+
+# the root of the Hadoop installation
+HADOOP_HOME=`dirname $this`/..
+
+if [ -f "$HADOOP_HOME/conf/hadoop-env.sh" ]; then
+  source ${HADOOP_HOME}/conf/hadoop-env.sh
+fi
+
 if [ "$HADOOP_SLAVES" = "" ]; then
-  export HADOOP_SLAVES=$HOME/.slaves
+  export HADOOP_SLAVES=$HADOOP_HOME/conf/slaves
 fi
 
 for slave in `cat $HADOOP_SLAVES`; do

Propchange: lucene/hadoop/trunk/conf/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Feb 15 11:53:52 2006
@@ -1,2 +1,4 @@
 hadoop-site.xml
 mapred-default.xml
+slaves
+hadoop-env.sh

Added: lucene/hadoop/trunk/conf/hadoop-env.sh.template
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/conf/hadoop-env.sh.template?rev=378078&view=auto
==============================================================================
--- lucene/hadoop/trunk/conf/hadoop-env.sh.template (added)
+++ lucene/hadoop/trunk/conf/hadoop-env.sh.template Wed Feb 15 11:53:52 2006
@@ -0,0 +1,25 @@
+# Set Hadoop-specific environment variables here.
+
+# The java implementation to use.
+# export JAVA_HOME=/usr/bin/java
+
+# The maximum amount of heap to use, in MB. Default is 1000.
+# export HADOOP_HEAPSIZE=2000
+
+# Extra Java runtime options.  Empty by default.
+# export HADOOP_OPTS=-server
+
+# Where log files are stored.  $HADOOP_HOME/logs by default.
+# export HADOOP_LOG_DIR=${HADOOP_HOME}/logs
+
+# File naming remote slave hosts.  $HADOOP_HOME/conf/slaves by default.
+# export HADOOP_SLAVES=${HADOOP_HOME}/conf/slaves
+
+# host:path where hadoop code should be rsync'd from.  Unset by default.
+# export HADOOP_MASTER=master:/home/$USER/src/hadoop
+
+# The directory where pid files are stored. /tmp by default.
+# export HADOOP_PID_DIR=/var/hadoop/pids
+
+# A string representing this instance of hadoop. $USER by default.
+# export HADOOP_IDENT_STRING=$USER

Added: lucene/hadoop/trunk/conf/slaves.template
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/conf/slaves.template?rev=378078&view=auto
==============================================================================
--- lucene/hadoop/trunk/conf/slaves.template (added)
+++ lucene/hadoop/trunk/conf/slaves.template Wed Feb 15 11:53:52 2006
@@ -0,0 +1 @@
+localhost



Mime
View raw message