How To Install Apache Hadoop on Ubuntu 18.04 LTS

Install Apache Hadoop on Ubuntu 18.04 LTS

In this tutorial, we will show you how to install Apache Hadoop on Ubuntu 18.04 LTS. For those of you who didn’t know, Apache Hadoop is an open-source framework used for distributed storage as well as distributed processing of big data on clusters of computers which runs on commodity hardware. Hadoop stores data in Hadoop Distributed File System (HDFS) and the processing of these data is done using MapReduce. YARN provides an API for requesting and allocating resources in the Hadoop cluster.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Apache Hadoop on an Ubuntu 18.04 Bionic Beaver server.

Install Apache Hadoop on Ubuntu 18.04 LTS Bionic Beaver

Step 1. First, make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

Step 2. Installing Java (OpenJDK).

Since Hadoop is based on java, make sure you have java JDK installed on the system. If you don’t have Java installed on your system, use the following link to install it first.

Step 3. Installing Apache Hadoop on Ubuntu 18.04.

To avoid security issues, we recommend to set up a new Hadoop user group and user account to deal with all Hadoop related activities, following command:

After creating the user, it also required to set up key-based ssh on its own account. To do this use execute following commands:

Download the latest stable version of Apache Hadoop, At the moment of writing this article it is version 2.8.1:

Step 4. Configure Apache Hadoop.

Setting up the environment variables. Edit ~/.bashrc file and append following values at end of file:

Apply environmental variables to the current running session:

Now edit $HADOOP_HOME/etc/hadoop/ file and set JAVA_HOME environment variable:

Hadoop has many configuration files, which need to configure as per requirements of your hadoop infrastructure. Let’s start with the configuration with basic Hadoop single node cluster setup:

Edit core-site.xml:

Edit hdfs-site.xml:

Edit mapred-site.xml:

Edit yarn-site.xml:

Now format namenode using the following command, do not forget to check the storage directory:

Start all hadoop services use the following command:

You should observe the output to ascertain that it tries to start datanode on slave nodes one by one. To check if all services are started well using ‘jps‘ command:

Step 5. Accessing Apache Hadoop.

Apache Hadoop will be available on HTTP port 8088 and port 50070 by default. Open your favourite browser and navigate to or http://server-ip:50070. If you are using a firewall, please open port 8088 and 50070 to enable access to the control panel.

Congratulations! You have successfully installed Hadoop. Thanks for using this tutorial for installing Apache Hadoop on Ubuntu 18.04 LTS system. For additional help or useful information, we recommend you to check the official Apache Hadoop website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!