Hello everyone, In this blog I am going to show how to install hadoop on multi-node cluster. Follow the below steps to install hadoop on ubuntu system.


Install Java

Java is the main prerequisite for Hadoop. You can download java in the below link

Mapping the nodes

To map the nodes edit the /etc/hosts file with following command.

$ sudo vi /etc/hosts


Add following hostname and their IP in the /etc/hosts file Hadoopmaster Hadoopnode1 Hadoopnode2


Creating User Account

Create a system user account on both master and slave systems to use the Hadoop installation. The following commands will be used to create the user account.

$ sudo addgroup hadoop

$ sudo adduser –ingroup hadoop hduser

Add following line in /etc/sudoers/

hduser ALL=(ALL:ALL) ALL

Setup ssh in every node such that they can communicate with one another without any prompt for password.

#First login with hduser (and from now use only hduser account for further steps)

$ sudo su hduser

# Generate ssh key for hduser account

$ ssh-keygen -t rsa -P “”


#Configure password-less SSH

$ cat $HOME/.ssh/ >> $HOME/.ssh/authorized_keys

Download Hadoop

Download any stable version of hadoop fron apache downloads and untar the file. Then move the hadoop package to /home directory. The below command is used to download the hadoop.

$ wget

Now make changes in below files in hadoop package to configure multi-node cluster.

a. edit yarn-site.xml by using the command

$ sudo gedit yarn-site.xml

Add the following entry to the file and save and quit the file:


        <!– Site specific YARN configuration properties –>










b. edit core-site.xml by using the command

$ sudo gedit core-site.xml

Add the following entry to the file and save and quit the file:






The name of the default file system. A URI whose scheme and authority determine the FileSystem implementation. The uri’s scheme determines the config property (fs.SCHEME.impl) naming the FileSystem implementation class. The uri’s authority is used to determine the host, port, etc. for a filesystem.






<description>A base for other temporary directories.</description>



c. edit mapred-site.xml

i. copy the contents of mapred-site.xml.template to mapred-site.xml by the command

$ mv mapred-site.xml.template mapred-site.xml

ii. By using this command, edit mapred-site.xml

$ sudo gedit mapred-site.xml

Add the following entry to the file and save and quit the file:






The host and port that the MapReduce job tracker runsat. If “local”, then jobs are run in-process as a single map and reduce task.








d. edit hdf-site.xml by using the command

$ sudo gedit hdfs-site.xml

Add the following entry to the file and save and quit the file:






Default block replication. The actual number of replications can be specified when the file is created. The default is used if replication is not specified in create time.




e. Update .bashrc file by using the command

$ sudo gedit .bashrc

Add the following entry to the file and save and quit the file:

# Set Hadoop-related environment variables

export HADOOP_HOME=/home/techm/hadoop





# Native Path


export HADOOP_OPTS=”-Djava.library.path=$HADOOP_HOME/lib”

#Java path

export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd6


# Add Hadoop bin/ directory to PATH



Formatting the HDFS filesystem via the NameNode

Before we start our new multi-node cluster, we must format Hadoop’s distributed filesystem (HDFS) via the NameNode. You need to do this the first time you set up an Hadoop cluster.The following command is used to format the namenode.

$ hadoop namenode -format

Then start the hadoop multi-node cluster using the command

$ bin/

Check whether the services are running using the command

$ jps

To stop the running hadoop cluster use the command

$ bin/


Thanks for reading the blog, hope it will help. Please leave your comment below.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s