Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
HDFS, mail # user - How can I run hadoop from source checkout?


Copy link to this message
-
How can I run hadoop from source checkout?
Ravi Prakash 2011-07-07, 14:53
Hi folks,

I think I remember seeing a few of changes in the starting scripts. Can
someone please point me to a twiki containing steps on how to start up
Hadoop from a source checkout? The method I used to use (export
HADOOP_HDFS_HOME, HADOOP_COMMON_HOME, and then calling hdfs/bin/start-dfs.sh
doesn't work perfectly anymore.

This is what I get when I do that now :
$ start-dfs.sh
/home/raviprak/Code/hadoop/hadoop-common/hdfs/bin/start-dfs.sh: line 54:
/home/raviprak/Code/hadoop/hadoop-common/common/bin/../bin/hdfs: No such
file or directory
Starting namenodes on []
localhost: starting namenode, logging to
/home/raviprak/Code/hadoop/hadoop-common/common/bin/../logs/hadoop-raviprak-namenode-foundrecord.champ.corp.yahoo.com.out
localhost: starting datanode, logging to
/home/raviprak/Code/hadoop/hadoop-common/common/bin/../logs/hadoop-raviprak-datanode-foundrecord.champ.corp.yahoo.com.out
Secondary namenodes are not configured.  Cannot start secondary namenodes.
$ jps
5232 Jps
5157 DataNode
4974 NameNode
When I made this change, SNN started up too.
$ git diff
diff --git a/hdfs/bin/start-dfs.sh b/hdfs/bin/start-dfs.sh
index dc41729..6a25149 100755
--- a/hdfs/bin/start-dfs.sh
+++ b/hdfs/bin/start-dfs.sh
@@ -80,6 +80,7 @@ fi
 # 0.0.0.0 or empty string
 SECONDARY_NAMENODES=$($HADOOP_PREFIX/bin/hdfs getconf -secondarynamenodes
2>&-)
 SECONDARY_NAMENODES=${SECONDARY_NAMENODES:='0.0.0.0'}
+SECONDARY_NAMENODES=localhost

 if [ "$SECONDARY_NAMENODES" = '0.0.0.0' ] ; then
   echo \
diff --git a/hdfs/bin/stop-dfs.sh b/hdfs/bin/stop-dfs.sh
index c39e54c..76e5405 100755
--- a/hdfs/bin/stop-dfs.sh
+++ b/hdfs/bin/stop-dfs.sh
@@ -56,6 +56,7 @@ fi
 # 0.0.0.0 or empty string
 SECONDARY_NAMENODES=$($HADOOP_PREFIX/bin/hdfs getconf -secondarynamenodes
2>&-)
 SECONDARY_NAMENODES=${SECONDARY_NAMENODES:-'0.0.0.0'}
+SECONDARY_NAMENODES=localhost

 if [ "$SECONDARY_NAMENODES" = '0.0.0.0' ] ; then
   echo \

This is a pretty hacky way! I know I know. What's the best way?

Thanks,
Ravi