0
0
Hadoopdata~10 mins

Why YARN manages cluster resources in Hadoop - Visual Breakdown

Choose your learning style9 modes available
Concept Flow - Why YARN manages cluster resources
User submits job
YARN ResourceManager receives job
ResourceManager checks cluster resources
ResourceManager allocates resources
NodeManagers launch containers
Application runs using allocated resources
ResourceManager monitors and manages resources
Job completes and resources are freed
YARN manages cluster resources by receiving jobs, checking available resources, allocating them, and monitoring usage until job completion.
Execution Sample
Hadoop
1. Submit job to YARN
2. ResourceManager checks resources
3. Allocate containers on nodes
4. Run job in containers
5. Monitor and free resources
This sequence shows how YARN manages resources from job submission to completion.
Execution Table
StepActionResourceManager StateNodeManager StateResult
1Job submittedWaiting for resource checkIdleJob queued
2Check cluster resourcesResources available: 10GB RAM, 8 coresIdleReady to allocate
3Allocate containersAllocating 4GB RAM, 2 coresPreparing containersContainers allocated
4Launch containersTracking allocated containersContainers running jobJob started
5Monitor jobUpdating resource usageRunning containersJob progressing
6Job completesReleasing resourcesContainers stoppedResources freed
7Idle stateResources available: 10GB RAM, 8 coresIdleReady for next job
💡 Job completes and resources are freed for new jobs
Variable Tracker
VariableStartAfter Step 2After Step 3After Step 6Final
Available RAM10GB10GB6GB10GB10GB
Available CPU cores88688
Job StateNot submittedQueuedRunningCompletedIdle
Key Moments - 3 Insights
Why does ResourceManager check resources before allocating?
ResourceManager must ensure enough resources exist to run the job without overloading nodes, as shown in step 2 of the execution_table.
What happens if resources are not available?
The job stays queued until resources free up, so ResourceManager waits before allocating containers (not shown in this trace but implied in step 1 and 2).
Why does YARN monitor resource usage during job execution?
To track progress and free resources promptly after job completion, as seen in steps 5 and 6.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the ResourceManager state after allocating containers?
ATracking allocated containers
BAllocating 4GB RAM, 2 cores
CResources available: 10GB RAM, 8 cores
DReleasing resources
💡 Hint
Check the ResourceManager State column at step 4 in the execution_table
At which step does the job start running on NodeManagers?
AStep 3
BStep 5
CStep 4
DStep 6
💡 Hint
Look at the NodeManager State column to see when containers run the job
If the available RAM was only 2GB at step 2, what would happen?
AJob runs with less resources
BJob stays queued until enough RAM is free
CResourceManager allocates containers anyway
DJob is canceled immediately
💡 Hint
ResourceManager checks resources before allocation as shown in step 2
Concept Snapshot
YARN manages cluster resources by:
- Receiving job requests
- Checking available resources
- Allocating containers on nodes
- Running jobs inside containers
- Monitoring and freeing resources after job completion
Full Transcript
YARN manages cluster resources by first receiving a job submission. The ResourceManager checks the cluster's available resources to ensure there is enough memory and CPU to run the job. It then allocates containers on NodeManagers, which launch the job. During execution, YARN monitors resource usage to track progress and manage resources efficiently. Once the job finishes, resources are freed for new jobs. This process helps keep the cluster balanced and jobs running smoothly.