Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

NUTCH-1085 Nutch script does not require HADOOP_HOME

Julien Nioche78292c907f5b
diff --git a/CHANGES.txt b/CHANGES.txt
index bd5eafb88..2bc8fa501 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -2,6 +2,8 @@ Nutch Change Log
Release 1.4 - Current development
+* NUTCH-1085 Nutch script does not require HADOOP_HOME (jnioche)
+
* NUTCH-1075 Delegate language identification to Tika (jnioche)
* NUTCH-1049 Add classes to bin/nutch script (markus)
diff --git a/src/bin/nutch b/src/bin/nutch
index 8ced96eee..b0ab94fa2 100755
--- a/src/bin/nutch
+++ b/src/bin/nutch
@@ -90,11 +90,6 @@ shift
THIS_DIR=`dirname "$THIS"`
NUTCH_HOME=`cd "$THIS_DIR/.." ; pwd`
-# determine HADOOP_HOME
-if [ "$HADOOP_HOME" = "" ]; then
- HADOOP_HOME=$NUTCH_HOME
-fi
-
# some Java parameters
if [ "$NUTCH_JAVA_HOME" != "" ]; then
#echo "run java in $NUTCH_JAVA_HOME"
@@ -253,14 +248,14 @@ else
fi
# distributed mode
-EXEC_CALL="$HADOOP_HOME/bin/hadoop jar $NUTCH_JOB"
+EXEC_CALL="hadoop jar $NUTCH_JOB"
if $local; then
EXEC_CALL="$JAVA $JAVA_HEAP_MAX $NUTCH_OPTS -classpath $CLASSPATH"
else
- # check that we are really in a hadoop config
- if [ ! -f ${HADOOP_HOME}/bin/hadoop ]; then
- echo "Can't find Hadoop scripts. Set HADOOP_HOME to a valid home of Hadoop installation."
+ # check that hadoop can be found on the path
+ if [ $(which hadoop | wc -l ) -eq 0 ]; then
+ echo "Can't find Hadoop executable. Add HADOOP_HOME/bin to the path or run in local mode."
exit -1;
fi
fi