Hadoop Installation(Single-Node)-2/3
Hadoop 1.0.4 on Ubuntu Linux 12.04 ( Single Node )- Part -2/3
Download Hadoop
- Download a stable hadoop version from http://hadoop.apache.org/
- I downloaded the this version - hadoop 1.0.4 and this is the link to it stable hadoop download page.
- Download the file (hadoop-1.0.4.tar.gz) and copy it under the home directory of hadoop_usr ( ie. /home/hadoop_usr/)
Steps to Install
Login to terminal as hadoop_usr and extract the contents of the gz filetar -xvf hadoop-1.0.4.tar.gzWe have to edit the following configuration file
- $HADOOP_HOME/conf/hadoop-env.sh
- $HADOOP_HOME/conf/hdfs-site.xml
- $HADOOP_HOME/conf/core-site.xml
- $HADOOP_HOME/conf/mapred-site.xml
- $HADOOP_HOME/conf/masters
- $HADOOP_HOME/conf/slaves
$HADOOP_HOME/conf/hadoop-env.sh
set the Java home
# The java implementation to use.Required. # export JAVA_HOME=/usr/lib/j2sdk1.5-sun export JAVA_HOME=/usr/lib/jvm/java-7-oracle
$HADOOP_HOME/conf/hdfs-site.xml
before editing this file create the following folder.
mkdir /home/hadoop_usr/hadoop-1.0.4/data mkdir /home/hadoop_usr/hadoop-1.0.4/namenow edit the hdfs-site.xml and add the following lines
<configuration> <property> <name>dfs.data.dir</name> <value>/home/hadoop_usr/hadoop-1.0.4/data</value> </property> <property> <name>dfs.namenode.name.dir</name> <value>/home/hadoop_usr/hadoop-1.0.4/name</value> </property> <property> <name>dfs.replication</name> <value>1</value> </property> </configuration>
$HADOOP_HOME/conf/core-site.xml
before editing this file. Create a tmp directory for hadoop's use. I created mine under the following directory.mkdir /home/hadoop_usr/hadoop-1.0.4/tmpnow edit the core-site.xml file and add the following values
<configuration> <property> <name>hadoop.tmp.dir</name> <value>/home/hadoop_usr/hadoop-1.0.4/tmp/tmp-${user.name}</value> </property> <property> <name>fs.default.name</name> <value>hdfs://localhost:9000</value> </property> </configuration>
$HADOOP_HOME/conf/mapred-site.xml
<property> <name>fs.default.name< /name> <value>hdfs://localhost:9100</value> </property> <property> <name>mapred.job.tracker< /name> <value>localhost:9101< /value> </property>
$HADOOP_HOME/conf/masters
Edit this file and add the following linelocalhost
$HADOOP_HOME/conf/slaves
Edit this file and add the following linelocalhost
Comments