How to Setup Hadoop 2.6.0 on Linux

Apache Hadoop 2.6 significant improvements over the previous stable releases Of Hodoop 2.z.x. This how to guide will help you to install Hadoop 2.6 on CentOS/RHEL and Ubuntu System, This version has many improvements in HDFS and MapReduce.

hadoop-tt This article provide basic knowledge of Hadoop Server installation.

Step 1: Installing Java

Make sure you have Java installed on your system using following command.
# java -version 

java version "1.8.0_32"
Java(TM) SE Runtime Environment (build 1.7.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM1 (build 26.31-b07, mixed mode)
If Java not installed in your server, then file below command to install Java
#yum install Jdk* (in RHEL/CentOS)
#sudo add-apt-repository ppa:webupd8team/java   (in Ubunto)


Step 2: Creating Hadoop User

Aur recommendation is to create a normal (nor root) account for hadoop working.
# useradd hadoop
# passwd hadoop
Once User created, set up key based ssh to its own account. Fallow bellow commands.
# su - hadoop
$ ssh-keygen -t rsa
$ cat ~/.ssh/ >> ~/.ssh/authorized_keys
$ chmod 0600 ~/.ssh/authorized_keys


Step 3. Downloading Hadoop 2.6.0

Now download hadoop 2.6.0 source  file using below command.
$ cd /opt
$ wget
$ tar xzf hadoop-2.6.0.tar.gz
$ mv hadoop-2.6.0 hadoop

Step 4. Configure Hadoop Pseudo-Distributed Mode

4.1. Setup Environment Variables

First we need to set environment variable uses by hadoop. Edit ~/.bashrc file and append following values at end of file.

export HADOOP_HOME=/home/hadoop/hadoop

Now run below command to  get Hadoop environment Variable in Current Session.

$ source ~/.bashrc

Now edit one more variable component $HADOOP_HOME/etc/hadoop/ file and set JAVA_HOME environment variable

export JAVA_HOME=/opt/jdk1.8.0_31/

4.2. Edit Configuration Files

Hadoop has many of configuration files, which need to configure as per requirements of your hadoop infrastructure. Lets start with the configuration with basic hadoop single node cluster setup. first navigate to below location
$ cd $HADOOP_HOME/etc/hadoop

Edit core-site.xml


Edit hdfs-site.xml




Edit mapred-site.xml


Edit yarn-site.xml


4.3. Format Namenode

Now format the namenode using following command, make sure that Storage directory is

$ hdfs namenode -format

Sample output:

15/02/04 09:58:43 INFO namenode.NameNode: STARTUP_MSG:
STARTUP_MSG: Starting NameNode
STARTUP_MSG:   host =
STARTUP_MSG:   args = [-format]
STARTUP_MSG:   version = 2.6.0
15/02/04 09:58:57 INFO common.Storage: Storage directory /home/hadoop/hadoopdata/hdfs/namenode has been successfully formatted.
15/02/04 09:58:57 INFO namenode.NNStorageRetentionManager: Going to retain 1 images with txid >= 0
15/02/04 09:58:57 INFO util.ExitUtil: Exiting with status 0
15/02/04 09:58:57 INFO namenode.NameNode: SHUTDOWN_MSG:
SHUTDOWN_MSG: Shutting down NameNode at

Step 5. Start Hadoop Cluster

Lets start your hadoop cluster using the scripts provides by hadoop. Just navigate to your hadoop sbin directory and execute scripts one by one.

$ cd $HADOOP_HOME/sbin/

Now run script.


Sample output:

15/02/04 10:00:34 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Starting namenodes on [localhost]
localhost: starting namenode, logging to /home/hadoop/hadoop/logs/
localhost: starting datanode, logging to /home/hadoop/hadoop/logs/
Starting secondary namenodes []
The authenticity of host ' (' can't be established.
RSA key fingerprint is 3c:c4:f6:f1:72:d9:84:f9:71:73:4a:0d:55:2c:f9:43.
Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '' (RSA) to the list of known hosts. starting secondarynamenode, logging to /home/hadoop/hadoop/logs/
15/02/04 10:01:15 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

Now run script.

Sample output:
starting yarn daemons
starting resourcemanager, logging to /home/hadoop/hadoop/logs/
localhost: starting nodemanager, logging to /home/hadoop/hadoop/logs/

Step 6. Access Hadoop Services in Browser

Hadoop NameNode started on port 50070 default. Access your server on port 50070 in your favorite web browser.


Leave a Reply

Your email address will not be published. Required fields are marked *