There Are Two Ways To Install Hadoop in Ubantu
There Are Two Ways To Install Hadoop in Ubantu
There Are Two Ways To Install Hadoop in Ubantu
A single node cluster means only one DataNode running and setting up all the
NameNode, DataNode, ResourceManager, and NodeManager on a single machine.
This is used for studying and testing purposes. For example, let us consider a
sample data set inside the healthcare industry. So, for testing whether the Oozie jobs
have scheduled all the processes like collecting, aggregating, storing, and
processing the data in a proper sequence, we use a single node cluster. It can easily
and efficiently test the sequential workflow in a smaller environment as compared to
large environments which contain terabytes of data distributed across hundreds of
machines.
While in a Multi-node cluster, there are more than one DataNode running and each
DataNode is running on different machines. The multi-node cluster is practically used
in organizations for analyzing Big Data. Considering the above example, in real-time
when we deal with petabytes of data, it needs to be distributed across hundreds of
machines to be processed. Thus, here we use a multi-node cluster.
Prerequisites
VIRTUAL BOX: it is used for installing the operating system on it.
OPERATING SYSTEM: You can install Hadoop on Linux-based operating
systems. Ubuntu and CentOS are very commonly used. In this tutorial, we are
using CentOS.
JAVA: You need to install the Java 8 package on your system.
HADOOP: You require Hadoop 2.7.3 package.
Install Hadoop
Step 1: Click here to download the Java 8 Package. Save this file in your
home directory.
Command: wget https://archive.apache.org/dist/hadoop/core/hadoop-2.7.3/hadoop-
2.7.3.tar.gz
Fig: Hadoop Installation – Downloading Hadoop
Step 5: Add the Hadoop and Java paths in the bash file (.bashrc).
Learn more about the Hadoop Ecosystem and its tools with the Hadoop Certification.
Command: vi .bashrc
For applying all these changes to the current Terminal, execute the source
command.
Command: source .bashrc
ig: Hadoop Installation – Refreshing environment variables
To make sure that Java and Hadoop have been properly installed on your system
and can be accessed through the Terminal, execute the java -version and hadoop
version commands.
Command: java -version
Command: hadoop version
Command: cd hadoop-2.7.3/etc/hadoop/
Command: ls
Command: vi core-site.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2 <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
3 <configuration>
4 <property>
5 <name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
6
</property>
7 </configuration>
8
Step 8: Edit hdfs-site.xml and edit the property mentioned below inside
configuration tag:
Command: cp mapred-site.xml.template mapred-site.xml
Command: vi mapred-site.xml.
ig: Hadoop Installation – Configuring mapred-site.xml
Command: vi yarn-site.xml
<?xml version="1.0">
<configuration>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<property>
<name>yarn.nodemanager.auxservices.mapreduce.shuffle.class</name>
<value>org.apache.hadoop.mapred.ShuffleHandler</value>
</property>
</configuration>
Step 11: Edit hadoop-env.sh and add the Java Path as mentioned below:
hadoop-env.sh contains the environment variables that are used in the script to run
Hadoop like Java home path, etc.
Command: vi hadoop–env.sh
Command: cd
Command: cd hadoop-2.7.3
This formats the HDFS via NameNode. This command is only executed for the first
time. Formatting the file system means initializing the directory specified by the
dfs.name.dir variable.
Never format, up and running Hadoop filesystem. You will lose all your data stored in
the HDFS.
Command: ./start-all.sh
Start NameNode:
The NameNode is the centerpiece of an HDFS file system. It keeps the directory tree
of all files stored in the HDFS and tracks all the file stored across the cluster.
Start DataNode:
Start ResourceManager:
ResourceManager is the master that arbitrates all the available cluster resources
and thus helps in managing the distributed applications running on the YARN
system. Its work is to manage each NodeManagers and the each application’s
ApplicationMaster.
Start NodeManager:
The NodeManager in each machine framework is the agent which is responsible for
managing containers, monitoring their resource usage and reporting the same to the
ResourceManager.
Start JobHistoryServer:
JobHistoryServer is responsible for servicing all job history related requests from
client.
Step 14: To check that all the Hadoop services are up and running, run the
below command.
Command: jps
Fig: Hadoop Installation – Checking Daemons
Now that you have understood how to install Hadoop, check out the Hadoop admin
course by Edureka, a trusted online learning company with a network of more than
250,000 satisfied learners spread across the globe. The Edureka Big Data Hadoop
Certification Training course helps learners become experts in HDFS, Yarn,
MapReduce, Pig, Hive, HBase, Oozie, Flume, and Sqoop using real-time use cases
on Retail, Social Media, Aviation, Tourism, Finance domains.