How To Install Apache Hadoop on Debian 9 Stretch

Install Apache Hadoop on Debian 9 Stretch

In this tutorial we will show you how to install Apache Hadoop on Debian 9. 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 hardwares. 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 a Debian 9 (Stretch) server.

Install Apache Hadoop on Debian 9 Stretch

Step 1. Before we install any software, it’s important to make sure your system is up to date by running these following apt-get commands in the terminal:

Step 2. Installing Java (OpenJDK).

Apache Hadoop requires Java version 8 and above. So, you can choose to install either OpenJDK or Oracle JDK:

Step 3. Installing Apache Hadoop on Debian 9.

To avoid security issues, we recommend to setup 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:

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

Step 4. Setup Environment Apache Hadoop.

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

Apply environmental variables to current running session:

Now edit $HADOOP_HOME/etc/hadoop/hadoop-env.sh file and set JAVA_HOME environment variable:

Hadoop has many of 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. Setup Firewall for Apache Hadoop.

Allow Apache Hadoop through the firewall:

Step 6. Accessing Apache Hadoop.

Apache Hadoop will be available on HTTP port 8088 and port 50070 by default. Open your favorite browser and navigate to http://yourdomain.com:50070 or http://server-ip:50070.

Congratulation’s! You have successfully installed Apache Hadoop. Thanks for using this tutorial for installing Apache Hadoop in Debian 9 Stretch systems. For additional help or useful information, we recommend you to check the official Apache Hadoop web site.

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 a best deal!