Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 65

Hadoop Core Components: HDFS, YARN, and MapReduce

Recommended resources

Hello! Welcome to your next lesson in our module on data-parallel processing.

In our previous lesson, we explored the conceptual MapReduce programming model. We broke down how the map, shuffle, and reduce phases provide a powerful abstraction for processing massive datasets in parallel, hiding the complexities of distributed computing from the developer.

Today, we move from the abstract model to its most famous concrete implementation: Apache Hadoop. While MapReduce provides the blueprint for the computation, Hadoop provides the machinery to execute it at scale. Our learning outcome for this lesson is to describe the roles of HDFS (storage), YARN (resource management), and the MapReduce engine in the Hadoop ecosystem. We will see how these three core components work together to form a robust, scalable platform for big data processing.

1. What is Apache Hadoop?

Apache Hadoop is an open-source framework that allows for the distributed processing of large data sets across clusters of computers using simple programming models. It was created to solve problems involving massive amounts of data that couldn't fit or be processed on a single machine.

To get a high-level sense of what Hadoop is and why it's important, let's start with a brief introductory video.

What is Apache Hadoop?

This video from IBM Technology provides a concise overview of what Apache Hadoop is, its purpose, and the kinds of problems it solves.

Please watch the first three minutes of the video (from 00:00 to 02:48). Focus on: The core purpose of Hadoop: storing and processing massive datasets on clusters of commodity hardware. The types of data it can handle (structured, semi-structured, unstructured). The concept of running Hadoop on a cluster of standard, cost-effective computers.

As the video explains, Hadoop's power comes from its ability to distribute both data and computation across many machines. This is made possible by a sophisticated architecture built on several key components.


2. The Core Components of Hadoop

At its heart, the Hadoop framework is built on three pillars that manage storage, processing, and resources. Think of it like a well-organized factory:

  • Hadoop Distributed File System (HDFS): The factory's massive, fault-tolerant warehouse. It stores the raw materials and finished products (your data).
  • MapReduce Engine: The assembly line machinery. It executes the actual data processing tasks (map and reduce).
  • Yet Another Resource Negotiator (YARN): The factory floor manager. It allocates workers and machinery (CPU, memory) to various jobs and coordinates their activities.

Let's look at how these components are typically distributed across a cluster.

Hadoop Architecture Overview
This diagram shows a typical Hadoop cluster architecture. The Master Node runs the central management processes (NameNode for HDFS and ResourceManager for YARN), while the Slave Nodes run the processes that store data (DataNode), execute tasks, and manage local resources (NodeManager).

We will now examine the role of each of these three components in detail.


3. HDFS: The Distributed Storage Layer

The first component, HDFS, solves the problem of storing files that are far too large for a single disk.

The role of HDFS is to provide reliable, scalable, and fault-tolerant data storage across a cluster of machines. It achieves this by splitting large files into smaller, fixed-size blocks and distributing multiple copies (replicas) of these blocks across different machines, known as DataNodes. A central master server, the NameNode, keeps track of which blocks make up which files and where they are stored.

Hadoop Ecosystem Explained | Hadoop Ecosystem Architecture And Components | Hadoop | Simplilearn

This video from Simplilearn provides a clear, animated explanation of HDFS's role.

Watch the segment from 00:32 to 02:18. Pay attention to: The 'write-once, read-many' nature of HDFS. The master/slave roles of the NameNode and DataNodes. The concept of splitting a large file into blocks.

The key function of HDFS is to ensure data is not lost if a machine fails. By replicating each block (by default, three times) on different nodes, the system can transparently recover from hardware failures. This foundation of reliable storage is what the rest of the ecosystem builds upon.


4. MapReduce Engine: The Data Processing Framework

While HDFS handles storage, the MapReduce engine is the component responsible for executing the data processing logic defined by the user's map and reduce functions.

This is the concrete implementation of the model we studied in the last lesson. When a MapReduce job is run, the engine schedules map tasks and reduce tasks to run on the cluster's nodes. A crucial optimization it performs is data locality. The engine, guided by YARN, tries to schedule a map task on the same node where the data block it needs to process is stored. This minimizes network traffic, which is a major bottleneck in distributed systems.

Hadoop Ecosystem Explained | Hadoop Ecosystem Architecture And Components | Hadoop | Simplilearn

Let's return to the Simplilearn video to see how it describes the MapReduce processing layer within Hadoop.

Now watch the segment from 03:35 to 05:40. This will connect the conceptual map, shuffle, and reduce phases from our previous lesson to their execution within the Hadoop framework. Notice the mention of how it processes data in a 'parallelly distributed manner'.

In summary, the MapReduce engine's role is to take the programming model we learned and turn it into a running, distributed computation that leverages data locality for efficiency.


5. YARN: The Cluster Resource Manager

We now have storage (HDFS) and a processing framework (MapReduce). But what decides which job gets to run, where it runs, and how much CPU and memory it can use? That is the role of YARN.

YARN's role is to act as the distributed operating system for the Hadoop cluster. It manages and allocates cluster resources (like CPU cores and RAM) and schedules tasks for execution.

This is a critical architectural feature. Before YARN (in Hadoop 1.x), job scheduling and resource management were tightly coupled with the MapReduce engine. By separating them, YARN allows Hadoop to run other data processing frameworks—like Apache Spark, Apache Flink, or Apache Tez—on the same cluster, using the same underlying storage (HDFS).

YARN's architecture has a few key components of its own.

Hadoop YARN: Mastering Resource Management in Big Data

This article from Acceldata gives a focused and clear breakdown of YARN's architecture. We'll use it to understand the main components.

Please read the sections 'Understanding Hadoop YARN: The Resource Management Powerhouse' and 'Core components of Hadoop YARN: The building blocks'. Focus on understanding the specific responsibility of each component: ResourceManager (RM): The ultimate authority that manages resources for the entire cluster. NodeManager (NM): An agent on each machine that manages resources and containers on that specific node. ApplicationMaster (AM): A per-application manager that negotiates resources from the RM and works with NMs to execute tasks. Container: The basic unit of resource allocation (a bundle of CPU and memory).

To visualize how these YARN components interact, refer to the diagram below.

Apache Hadoop YARN Architecture
This diagram illustrates the YARN workflow. A client submits an application to the ResourceManager. The RM then launches an ApplicationMaster, which in turn negotiates for containers (resources) from the RM. Once granted, the AM works with the NodeManagers to launch tasks within those containers.

Now, let's trace the lifecycle of a job to see how YARN orchestrates everything.

Hadoop YARN: Mastering Resource Management in Big Data

The same Acceldata article provides a step-by-step walkthrough of a YARN job. This will solidify your understanding of how the components coordinate.

Read the section 'How Hadoop YARN works: Behind the scenes'. Follow the 7-step process from job submission to completion. This sequence clearly demonstrates the separation of concerns between the global ResourceManager and the application-specific ApplicationMaster.

By acting as a general-purpose resource manager, YARN makes the Hadoop ecosystem incredibly flexible and powerful, enabling it to be the foundation for a wide variety of data processing applications.


Conclusion

In this lesson, we demystified the core of the Apache Hadoop ecosystem by breaking it down into its three foundational components. We saw how they work in concert to deliver a scalable and fault-tolerant platform for big data.

Key Takeaways:

  • Hadoop is an open-source framework implementing the MapReduce model on clusters of commodity hardware.
  • The Hadoop Distributed File System (HDFS) is the storage layer. Its role is to reliably store massive datasets across the cluster by splitting files into replicated blocks.
  • The MapReduce Engine is the processing layer. Its role is to execute user-defined map and reduce tasks, optimizing for data locality.
  • Yet Another Resource Negotiator (YARN) is the management layer. Its role is to manage cluster resources (CPU, memory) and schedule applications, acting as the cluster's operating system.
  • These three components—storage (HDFS), processing (MapReduce), and resource management (YARN)—form the heart of the Hadoop 2.x architecture.

In our next lesson, we will zoom in on the storage layer. We will explore the architecture of HDFS in greater detail, examining the precise responsibilities of the NameNode and DataNodes and how block replication provides the fault tolerance that is so crucial to the entire system.