Hadoop 2.6.4 pseudo distributed mode installation on ubuntu 14.04


Hadoop is an Apache open source framework written in java that allows distributed processing of large datasets across clusters of computers using simple programming models.

The Hadoop framework application works in an environment that provides distributed storage and computation across clusters of computers. Hadoop is designed to scale up from single server to thousands of machines, each offering local computation and storage.

Pre Requirements

1) A machine with Ubuntu 14.04 LTS operating system installed.

2) Apache Hadoop 2.6.4 Software (Download Here)

Pseudo Distributed Mode (Single Node Cluster)

The Hadoop daemons run on a local machine, thus simulating a cluster on a small scale. Different Hadoop daemons run in different JVM instances, but on a single machine. HDFS is used instead of local FS.

Hadoop Pseudo Distributed Mode Installation on Ubuntu 14.04

Step 1 – Update. Open a terminal (CTRL + ALT + T) and type the following sudo command. It is advisable to run this before installing any package, and necessary to run it to install the latest updates, even if you have not added or removed any Software Sources.

Step 2 – Installing Java 7.

Step 3 – Install open-ssh server. It is a cryptographic network protocol for operating network services securely over an unsecured network. The best known example application is for remote login to computer systems by users.

Step 4 – Create a Group. We will create a group, configure the group sudo permissions and then add the user to the group. Here ‘hadoop’ is a group name and ‘hduser’ is a user of the group.

Step 5 – Configure the sudo permissions for ‘hduser’.

Since by default ubuntu text editor is nano we will need to use CTRL + O to edit.

Add the permissions to sudoers.

Use CTRL + X keyboard shortcut to exit out. Enter Y to save the file.

Step 6 – Creating hadoop directory.

Step 7 – Change the ownership and permissions of the directory /usr/local/hadoop. Here ‘hduser’ is an Ubuntu username.

Step 8 – Switch User, is used by a computer user to execute commands with the privileges of another user account.

Step 9 – Change the directory to /home/hduser/Desktop , In my case the downloaded hadoop-2.6.4.tar.gz file is in /home/hduser/Desktop folder. For you it might be in /downloads folder check it.

Step 10 – Untar the hadoop-2.6.4.tar.gz file.

Step 11 – Move the contents of hadoop-2.6.4 folder to /usr/local/hadoop

Step 12 – Edit $HOME/.bashrc file by adding the java and hadoop path.

$HOME/.bashrc file. Add the following lines

Step 13 – Reload your changed $HOME/.bashrc settings

Step 14 – Generating a new SSH public and private key pair on your local computer is the first step towards authenticating with a remote server without a password. Unless there is a good reason not to, you should always authenticate using SSH keys.

Step 15 – Now you can add the public key to the authorized_keys

Step 16 – Adding localhost to list of known hosts. A quick way of making sure that ‘localhost’ is added to the list of known hosts so that a script execution doesn’t get interrupted by a question about trusting localhost’s authenticity.

Step 17 – Change the directory to /usr/local/hadoop/etc/hadoop

Step 18 – Edit hadoop-env.sh file.

Step 19 – Add the below lines to hadoop-env.sh file. Save and Close.

Step 20 – Edit core-site.xml file.

Step 21 – Add the below lines to core-site.xml file. Save and Close.

Step 22 – Edit hdfs-site.xml file.

Step 23 – Add the below lines to hdfs-site.xml file. Save and Close.

Step 24 – Edit yarn-site.xml file.

Step 25 – Add the below lines to yarn-site.xml file. Save and Close.

Step 26 – Copy the default mapred-site.xml.template to mapred-site.xml

Step 27 – Edit mapred-site.xml file.

Step 28 – Add the below lines to mapred-site.xml file. Save and Close.

Step 29 – Edit slaves file.

Step 30 – Add the below line to slaves file. Save and Close.

Step 31 – Creating /app/hadoop/tmp directory.

Step 32 – Change the ownership and permissions of the directory /app/hadoop/tmp. Here ‘hduser’ is an Ubuntu username.

Step 33 – Change the directory to /usr/local/hadoop/sbin

Step 34 – Format the datanode.

Step 35 – Start NameNode daemon and DataNode daemon.

Step 36 – Start yarn daemons.

OR

Instead of steps 35 and 36 you can use below command. It is deprecated now.

Step 37 – The JPS (Java Virtual Machine Process Status Tool) tool is limited to reporting information on JVMs for which it has the access permissions.

Hadoop Pseudo Distributed Mode Installation on Ubuntu 14.04

Once the Hadoop cluster is up and running check the web-ui of the components as described below

NameNode Browse the web interface for the NameNode; by default it is available at

Hadoop Pseudo Distributed Mode Installation on Ubuntu 14.04

ResourceManager Browse the web interface for the ResourceManager; by default it is available at

Step 38 – Make the HDFS directories required to execute MapReduce jobs.

Step 39 – Copy the input files into the distributed filesystem.

Step 40 – Run some of the examples provided.

Hadoop Pseudo Distributed Mode Installation on Ubuntu 14.04

Step 41 – Examine the output files.

Step 42 – Stop NameNode daemon and DataNode daemon.

Step 43 – Stop Yarn daemons.

OR

Instead of steps 42 and 43 you can use below command. It is deprecated now.

Have any Question or Comment?

Leave a Reply

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