Installation Commands of Apache Hadoop 2.6.0 as Single Node Pseudo-Distributed mode on Ubuntu 14.10 (Step by Step)
February 16, 2015 Leave a comment
$ sudo apt-get update
$ sudo apt-get install default-jdk
$ java -version
$ sudo apt-get install ssh
$ sudo apt-get install rsync
$ ssh-keygen -t dsa -P ‘ ‘ -f ~/.ssh/id_dsa
$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
$ wget -c http://mirror.olnevhost.net/pub/apache/hadoop/common/current/hadoop-2.6.0.tar.gz
$ sudo tar -zxvf hadoop-2.6.0.tar.gz
$ sudo mv hadoop-2.6.0 /usr/local/hadoop
$ update-alternatives –config java
$ sudo gedit ~/.bashrc
#Hadoop Variables
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export HADOOP_HOME=/usr/local/hadoop
export PATH=$PATH:$HADOOP_HOME/bin
export PATH=$PATH:$HADOOP_HOME/sbin
export HADOOP_MAPRED_HOME=$HADOOP_HOME
export HADOOP_COMMON_HOME=$HADOOP_HOME
export HADOOP_HDFS_HOME=$HADOOP_HOME
export YARN_HOME=$HADOOP_HOME
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export HADOOP_OPTS=”-Djava.library.path=$HADOOP_HOME/lib”
Now apply the variables.
$ source ~/.bashrc
There are a number of xml files within the Hadoop folder that require editing which are:
- mapred-site.xml
- yarn-site.xml
- core-site.xml
- hdfs-site.xml
- hadoop-env.sh
The files can be found in /usr/local/hadoop/etc/hadoop/.First copy the mapred-site template file over and then edit it.
mapred-site.xml
Next, go to the following path.
$ cd /usr/local/hadoop/etc/Hadoop
Add the following text between the configuration tabs.
mapred-site.xml.template
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
yarn-site.xml
Add the following text between the configuration tabs.
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
core-site.xml
Add the following text between the configuration tabs.
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
hdfs-site.xml
Add the following text between the configuration tabs.
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.name.dir</name>
<value>file:///home/hadoopuser/hadoopspace/hdfs/namenode</value>
</property>
<property>
<name>dfs.data.dir</name>
<value>file:///home/hadoopuser/hadoopspace/hdfs/namenode/datanode</value>
</property>
Note other locations can be used in hdfs by separating values with a comma, e.g.
file:/home/hadoopuser/hadoopspace/hdfs/datanode, .disk2/Hadoop/datanode, . .
hadoop-env.sh
Add an entry for JAVA_HOME
export JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
$ mkdir -p /home/hadoopuser/hadoopspace/hdfs/namenode
$ mkdir -p /home/hadoopuser/hadoopspace/hdfs/datanode
$ sudo chown hadoopuser:hadoopuser -R /usr/local/hadoop
Next format the namenode.
Issue the following commands.
./start-dfs.sh
./start-yarn.sh
Issue the jps command and verify that the following jobs are running:
At this point Hadoop has been installed and configured
type on terminal ,
firefox http://localhost:50070(namenode)
firefox http://localhost:50075(datanode)
firefox http://localhost:50090(checkpoint namenode)
firefox http://localhost:8088(Yarn Cluster)
You must be logged in to post a comment.