What is the main role of the ResourceManager in Hadoop?
The ResourceManager manages the allocation of resources across all the nodes in the cluster. It tracks available resources and assigns them to applications.
Click to reveal answer
beginner
What does the NodeManager do in a Hadoop cluster?
The NodeManager runs on each node and manages the node's resources. It monitors resource usage like CPU and memory and reports this to the ResourceManager.
Click to reveal answer
intermediate
How do ResourceManager and NodeManager work together?
ResourceManager allocates resources and schedules tasks, while NodeManager executes tasks on its node and reports status back to ResourceManager.
Click to reveal answer
intermediate
Why is ResourceManager considered the master in YARN architecture?
Because it centrally manages all resource allocation and scheduling decisions for the entire cluster, coordinating all NodeManagers.
Click to reveal answer
advanced
What happens if a NodeManager fails in the cluster?
The ResourceManager detects the failure because it stops receiving heartbeats from that NodeManager and reallocates tasks to other healthy nodes.
Click to reveal answer
Which component in Hadoop is responsible for tracking resource usage on individual nodes?
ANodeManager
BResourceManager
CNameNode
DJobTracker
✗ Incorrect
NodeManager runs on each node and monitors resource usage like CPU and memory.
What is the primary function of the ResourceManager?
AStore data blocks
BManage resource allocation across the cluster
CExecute tasks on nodes
DMonitor network traffic
✗ Incorrect
ResourceManager manages resource allocation and scheduling for the whole cluster.
If a NodeManager stops sending heartbeats, what does the ResourceManager do?
AReallocates tasks to other nodes
BIgnores it
CShuts down the cluster
DRestarts the NodeManager automatically
✗ Incorrect
ResourceManager reallocates tasks to healthy nodes when a NodeManager fails.
Which of these is NOT a responsibility of the NodeManager?
AMonitoring resource usage on the node
BReporting node status to ResourceManager
CLaunching and managing containers
DAllocating resources cluster-wide
✗ Incorrect
ResourceManager handles cluster-wide resource allocation, not NodeManager.
In YARN, the ResourceManager acts as the:
AData storage node
BSlave node
CMaster node
DClient node
✗ Incorrect
ResourceManager is the master node managing resource allocation and scheduling.
Explain the roles of ResourceManager and NodeManager in Hadoop and how they interact.
Think about who controls the whole cluster and who controls each node.
You got /5 concepts.
Describe what happens when a NodeManager fails in a Hadoop cluster.
Focus on failure detection and task reassignment.
You got /5 concepts.
Practice
(1/5)
1. What is the main role of the ResourceManager in a Hadoop cluster?
easy
A. It manages tasks on a single node.
B. It controls and schedules resources for the entire cluster.
A. KeyError because 'node2' does not exist; add 'node2' to resources before subtracting.
B. TypeError because subtraction is invalid; convert values to int first.
C. SyntaxError due to missing colon; add colon after else.
D. No error; code runs fine.
Solution
Step 1: Identify the error cause
When requested (6) is greater than node1's resources (5), code tries to subtract from 'node2' which is not in the dictionary, causing KeyError.
Step 2: Fix the error
Add 'node2' key with initial resources before subtracting or handle missing keys safely.
Final Answer:
KeyError because 'node2' does not exist; add 'node2' to resources before subtracting. -> Option A
Quick Check:
Missing key causes KeyError [OK]
Hint: Check if dictionary keys exist before accessing [OK]
Common Mistakes:
Ignoring missing keys causing runtime errors
Assuming subtraction always succeeds
Confusing syntax errors with runtime errors
5. You want to design a simple simulation where the ResourceManager assigns tasks to NodeManagers based on available resources. Given the following data: