SlideShare une entreprise Scribd logo
1  sur  16
What is YARN?
• YARN stands for Yet Another Resource Negotiator. It’s a framework introduced in 2010 by a group ay Yahoo!. This is
considered as next generation of MapReduce. YARN is not specific for MapReduce. It can be used for running any
application.
Why YARN?
• In a Hadoop cluster which has more than 4000 nodes, Classic MapReduce hit scalability bottlenecks. This is because
JobTracker does too many things like job scheduling, monitoring task progress by keeping track of tasks, restarting failed or
slow tasks and doing task bookkeeping (like managing counter totals).
How YARN solves the problem?
• The problem is solved by splitting the responsibility of JobTracker (in Classic MapReduce) to different components. Because
of which, there are more entities involved in YARN (compared to Classic MR). The entities in YARN are as follows;
• Client: which submits the MapReduce job
• Resource Manager: which manages the use of resources across the cluster. It creates new containers for Map and
Reduce processes.
• Node Manager: In every new container created by Resource Manager, a Node Manager process will be run which
oversees the containers running on the cluster nodes. It doesn’t matter if the container is created for Map or Reduce
or any other process. Node Manager ensures that the application does not use more resources than what it is
allocated with.
• Application Master: which negotiates with the Resource Manager for resources and runs the application-specific
process (Map or Reduce tasks) in those clusters. The Application Master & the MapReduce tasks run in containers
that are scheduled by the resource manager and managed by the node manager.
• HDFS
How to activate YARN?
• By setting the property ‘mapreduce.framework.name’ to ‘yarn’, the YARN framework will be activated. From then on when a
Job is submitted, YARN framework will be used to execute the Job.
FIRST A JOB HAS TO BE SUBMITTED TO
HADOOP CLUSTER. LET’S SEE HOW JOB
SUBMISSION HAPPENS IN CASE OF YARN.
MR Program
Job
Client JVM
ResourceManager
HDFS
Folder in name of Application ID
getNewApplicationId()
submit() submitApplication()
Job Jar
Configuration Files
Computed Input
Splits
Resource Manager node
• Job submission in YARN is very similar to Classic MapReduce. In YARN its not called as Job
instead its called as Application.
• Client calls the submit() (or waitForCompletion()) method on Job.
• The Job.submit() does the following;
• A new application ID is retrieved from Resource Manager.
• Checks the input and output specification.
• Computes input slits.
• Creates a directory in the name of Application ID in HDFS.
• Copies Job jar, configuration files and computed input splits to this directory.
• Informs the Resource manager by executing the submitApplication() on the Resource
manager.
NEXT THE SUBMITTED JOB WILL BE INITIALIZED.
NOW LET’S SEE HOW JOB INITIALIZATION
HAPPENS IN YARN.
• ResourceManager.submitApplication() method hands over the job to scheduler.
• Scheduler creates a new Container.
• All containers in YARN will have an instance of NodeManager running in it, which manages
the actual process which is scheduled to run in the container.
• The actual process in this case is an application master. For a MR Job, the main class for an
application master is ‘MRAppMaster’.
• MRAppMaster initilizes the job by creating number of bookkeeping objects to track the job’s
progress as it receives progress & completion reports from the tasks.
• Next the MRAppMaster retrieves input splits from HDFS.
ResourceManag
er
submitApplication(
)
Scheduler
HDFS
Map Tasks
Reduce Tasks
Other Tasks
Bookkeeping Info
Input Splits stored in Job ID
directory in HDFS.
T1 T2 T3
T1
J
S
J
CS
1
S
2
S
3
• Now application master, creates one map task per split and it checks the
‘mapreduce.job.reduces’ property & creates those many number of reducers.
Container
NodeManager
Application
Master
MRAppMaster
• At this point, application master knows how big the job is and it decides if it can execute the
job in the same JVM as itself or should it run each of these tasks parallel in different
containers. Such small jobs are said to be uberized or run as uber task.
• This decision is made by the application master based on the following property
configurations;
• mapreduce.job.ubertask.maxmaps
• mapreduce.job.ubertask.maxreduces
• mapreduce.job.ubertask.maxbytes
• mapreduce.job.ubertask.enable
• Before any task can run, application master executes the job setup methods to create job’s
output directory.
IF THE JOB IS NOT RUN AS UBER TASK, THEN
APPLICATION MASTER REQUESTS CONTAINERS
FOR ALL MAP AND REDUCE TASK. THIS
PROCESS IS CALLED TASK ASSIGNMENT. NOW
LET’S SEE HOW TASK ASSIGNMENT HAPPENS
IN YARN.
• Application master sends heartbeat signal to Resource Manager every few seconds.
Application Master uses this signal to request containers for Map and Reduce tasks.
Resource
Manager
Application Master sends a heartbeat
signal with request for map and reduce
tasks
• The container request includes information about map task’s data locality i.e., host and rack
in which the split resides.
• Unlike MR 1, where there are fixed number of slots and fixed amount of resources allocated,
YARN is pretty flexible in resource allocation. The request (which is sent along with the
heartbeat signal) for container can include a request for amount of memory needed for the
task. The default for map and reduce task is 1024 MB.
• Scheduler uses this information to make scheduling decisions. Scheduler tries to do a local
placement. If not possible, it tried for rack-local placement. Else non-local placement. Refer :
Replica placement slide.
Container
NodeManager
MRAppMaster
• Once the Resource Manager gets this request, it creates a new container and starts Node
Manager instance in it to manage the Map or Reduce task for which the container was
created for. It also ensures that the requested amount of resources are allocated to the
NOW TASKS ARE ASSIGNED TO CONTAINER
WHICH FOLLOWS A SERIES OF STEPS TO
EXECUTE A TASK. LET’S SEE HOW TASKS ARE
EXECUTED IN A YARN CONTAINER.
Distributed
Cache
HDFS
Folder created in
container’s local.
• Application Master starts a container through the Node Manager running in the other
container.`• Node Manager (in the other container) spawns a new JVM process and launches a new Java
application called ‘YarnChild’. The reason for a new JVM process is same as MR 1. And
YARN doesn’t support JVM reuse.
• The work of YarnChild is to execute the actual process (Map or Reduce).
• First YarnChild tries to localize the resources like Job jar, configuration files and supporting
files from Distribute Cache.
• Once the resources are localized, YarnChild begins executing the Map or Reduce task.
Container
NodeManager
Container
NodeManager
MRAppMaster
JVM Process
YarnChild
Map/Reduce
Task
Un-jar the job jar
contents
SINCE TASKS ARE EXECUTED IN A DISTRIBUTED
ENVIRONMENT, TRACKING THE PROGRESS AND
STATUS OF JOB IS TRICKY. LET’S SEE HOW
PROGRESS AND STATUS UPDATES ARE TAKEN
CARE IN YARN.
• Clients poll the Application master every second to receive the progress updates. This can be
configured using the property mapreduce.client.progressmonitor.pollinterval.
• The Application Master then aggregates this to build the overall job progress.
• The task sends its progress and counters are sent to Application Master once in three
seconds.
Container
NodeManager
Container
NodeManager
MRAppMaster
JVM Process
YarnChild
Map/Reduce
Task
Client Node
Job
getStatus()
MapReduce
Program
Job: SFO Crime
Job Status: Running
Task & task status
• The Application Master Web UI displays all the running applications with links to the web Uis
of respective application masters, each of which displays further details on the MR job,
including its progress.
THIS EXECUTION PROCESS CONTINUES TILL ALL
THE TASKS ARE COMPLETED. ONCE THE LAST
TASK IS COMPLETED, MR FRAMEWORK ENTERS
THE LAST PHASE CALLED JOB COMPLETION.
• When the job is completed, the application master and task containers clean up their working
state, and the OutputCommiter’s job cleanup method is executed.
• If the property ‘job.end.notification.url’ is set, the Job Tracker will send a HTTP job notification
to the client.
• Job information is archived by the job history server to enable later interrogation by users if
desired.
THE END
PLEASE SEND YOUR VALUABLE FEEDBACK TO
RAJESH_1290K@YAHOO.COM

Contenu connexe

Tendances

Hadoop technology
Hadoop technologyHadoop technology
Hadoop technology
tipanagiriharika
 

Tendances (20)

Anatomy of classic map reduce in hadoop
Anatomy of classic map reduce in hadoop Anatomy of classic map reduce in hadoop
Anatomy of classic map reduce in hadoop
 
Hadoop Map Reduce
Hadoop Map ReduceHadoop Map Reduce
Hadoop Map Reduce
 
Big Data Analytics with Spark
Big Data Analytics with SparkBig Data Analytics with Spark
Big Data Analytics with Spark
 
Hadoop scheduler
Hadoop schedulerHadoop scheduler
Hadoop scheduler
 
Spark overview
Spark overviewSpark overview
Spark overview
 
Yarn.ppt
Yarn.pptYarn.ppt
Yarn.ppt
 
Map Reduce
Map ReduceMap Reduce
Map Reduce
 
Introduction to YARN and MapReduce 2
Introduction to YARN and MapReduce 2Introduction to YARN and MapReduce 2
Introduction to YARN and MapReduce 2
 
Hadoop technology
Hadoop technologyHadoop technology
Hadoop technology
 
Analyzing Flight Delays with Apache Spark, DataFrames, GraphFrames, and MapR-DB
Analyzing Flight Delays with Apache Spark, DataFrames, GraphFrames, and MapR-DBAnalyzing Flight Delays with Apache Spark, DataFrames, GraphFrames, and MapR-DB
Analyzing Flight Delays with Apache Spark, DataFrames, GraphFrames, and MapR-DB
 
Hadoop Architecture
Hadoop ArchitectureHadoop Architecture
Hadoop Architecture
 
Hadoop Overview & Architecture
Hadoop Overview & Architecture  Hadoop Overview & Architecture
Hadoop Overview & Architecture
 
Introduction to Hadoop
Introduction to HadoopIntroduction to Hadoop
Introduction to Hadoop
 
Introduction to Big Data & Hadoop Architecture - Module 1
Introduction to Big Data & Hadoop Architecture - Module 1Introduction to Big Data & Hadoop Architecture - Module 1
Introduction to Big Data & Hadoop Architecture - Module 1
 
Introduction to hadoop and hdfs
Introduction to hadoop and hdfsIntroduction to hadoop and hdfs
Introduction to hadoop and hdfs
 
Spark SQL
Spark SQLSpark SQL
Spark SQL
 
Hadoop seminar
Hadoop seminarHadoop seminar
Hadoop seminar
 
Map reduce presentation
Map reduce presentationMap reduce presentation
Map reduce presentation
 
Temporal databases
Temporal databasesTemporal databases
Temporal databases
 
Map Reduce
Map ReduceMap Reduce
Map Reduce
 

En vedette

Algebra 2 powerpoint
Algebra 2 powerpointAlgebra 2 powerpoint
Algebra 2 powerpoint
roohal51
 
Certificate 4 (1)
Certificate 4 (1)Certificate 4 (1)
Certificate 4 (1)
sabegu1
 
The history of video games goes as far back as the early 1940s
The history of video games goes as far back as the early 1940sThe history of video games goes as far back as the early 1940s
The history of video games goes as far back as the early 1940s
Jian Li
 
I did not go to School last Saturday
I did not go to School last SaturdayI did not go to School last Saturday
I did not go to School last Saturday
Sandra MP
 
Jill lintner's portfolio
Jill lintner's portfolioJill lintner's portfolio
Jill lintner's portfolio
ocwebservices
 
SIGEVOlution Spring 2007
SIGEVOlution Spring 2007SIGEVOlution Spring 2007
SIGEVOlution Spring 2007
Pier Luca Lanzi
 

En vedette (20)

Anatomy of file write in hadoop
Anatomy of file write in hadoopAnatomy of file write in hadoop
Anatomy of file write in hadoop
 
Anatomy of file read in hadoop
Anatomy of file read in hadoopAnatomy of file read in hadoop
Anatomy of file read in hadoop
 
Video Analysis in Hadoop
Video Analysis in HadoopVideo Analysis in Hadoop
Video Analysis in Hadoop
 
A Brief History of Big Data
A Brief History of Big DataA Brief History of Big Data
A Brief History of Big Data
 
Algebra 2 powerpoint
Algebra 2 powerpointAlgebra 2 powerpoint
Algebra 2 powerpoint
 
Certificate 4 (1)
Certificate 4 (1)Certificate 4 (1)
Certificate 4 (1)
 
The history of video games goes as far back as the early 1940s
The history of video games goes as far back as the early 1940sThe history of video games goes as far back as the early 1940s
The history of video games goes as far back as the early 1940s
 
I did not go to School last Saturday
I did not go to School last SaturdayI did not go to School last Saturday
I did not go to School last Saturday
 
Good prescribing
Good prescribingGood prescribing
Good prescribing
 
Zed-Sales™ - a flagship product of Zed-Axis Technologies Pvt. Ltd.
Zed-Sales™ - a flagship product of Zed-Axis Technologies Pvt. Ltd.Zed-Sales™ - a flagship product of Zed-Axis Technologies Pvt. Ltd.
Zed-Sales™ - a flagship product of Zed-Axis Technologies Pvt. Ltd.
 
DMI Light Towers - Operational Manual
DMI Light Towers - Operational ManualDMI Light Towers - Operational Manual
DMI Light Towers - Operational Manual
 
Tequila Appreciation
Tequila AppreciationTequila Appreciation
Tequila Appreciation
 
Sovereignty, Free Will, and Salvation - Limited Atonement
Sovereignty, Free Will, and Salvation - Limited AtonementSovereignty, Free Will, and Salvation - Limited Atonement
Sovereignty, Free Will, and Salvation - Limited Atonement
 
Wikihow howtomakespaghetti
Wikihow   howtomakespaghettiWikihow   howtomakespaghetti
Wikihow howtomakespaghetti
 
Biolog condtarea10
Biolog condtarea10Biolog condtarea10
Biolog condtarea10
 
3cork and kerry
3cork and kerry3cork and kerry
3cork and kerry
 
Because i believe i can
Because i believe i canBecause i believe i can
Because i believe i can
 
Jill lintner's portfolio
Jill lintner's portfolioJill lintner's portfolio
Jill lintner's portfolio
 
Aquamacs Manual
Aquamacs ManualAquamacs Manual
Aquamacs Manual
 
SIGEVOlution Spring 2007
SIGEVOlution Spring 2007SIGEVOlution Spring 2007
SIGEVOlution Spring 2007
 

Similaire à Anatomy of Hadoop YARN

Big data unit iv and v lecture notes qb model exam
Big data unit iv and v lecture notes   qb model examBig data unit iv and v lecture notes   qb model exam
Big data unit iv and v lecture notes qb model exam
Indhujeni
 
Juniper Innovation Contest
Juniper Innovation ContestJuniper Innovation Contest
Juniper Innovation Contest
AMIT BORUDE
 
Hadoop deconstructing map reduce job step by step
Hadoop deconstructing map reduce job step by stepHadoop deconstructing map reduce job step by step
Hadoop deconstructing map reduce job step by step
Subhas Kumar Ghosh
 

Similaire à Anatomy of Hadoop YARN (20)

Session 02 - Yarn Concepts
Session 02 - Yarn ConceptsSession 02 - Yarn Concepts
Session 02 - Yarn Concepts
 
MapReduce.pptx
MapReduce.pptxMapReduce.pptx
MapReduce.pptx
 
YARN (2).pptx
YARN (2).pptxYARN (2).pptx
YARN (2).pptx
 
Big data unit iv and v lecture notes qb model exam
Big data unit iv and v lecture notes   qb model examBig data unit iv and v lecture notes   qb model exam
Big data unit iv and v lecture notes qb model exam
 
Big Data Analytics Chapter3-6@2021.pdf
Big Data Analytics Chapter3-6@2021.pdfBig Data Analytics Chapter3-6@2021.pdf
Big Data Analytics Chapter3-6@2021.pdf
 
ApacheCon North America 2014 - Apache Hadoop YARN: The Next-generation Distri...
ApacheCon North America 2014 - Apache Hadoop YARN: The Next-generation Distri...ApacheCon North America 2014 - Apache Hadoop YARN: The Next-generation Distri...
ApacheCon North America 2014 - Apache Hadoop YARN: The Next-generation Distri...
 
YARN - way to share cluster BEYOND HADOOP
YARN - way to share cluster BEYOND HADOOPYARN - way to share cluster BEYOND HADOOP
YARN - way to share cluster BEYOND HADOOP
 
Hadoop 2.0 yarn arch training
Hadoop 2.0 yarn arch trainingHadoop 2.0 yarn arch training
Hadoop 2.0 yarn arch training
 
Juniper Innovation Contest
Juniper Innovation ContestJuniper Innovation Contest
Juniper Innovation Contest
 
Hadoop MapReduce Introduction and Deep Insight
Hadoop MapReduce Introduction and Deep InsightHadoop MapReduce Introduction and Deep Insight
Hadoop MapReduce Introduction and Deep Insight
 
writing Hadoop Map Reduce programs
writing Hadoop Map Reduce programswriting Hadoop Map Reduce programs
writing Hadoop Map Reduce programs
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
 
MapReduce
MapReduceMapReduce
MapReduce
 
Spark Overview and Performance Issues
Spark Overview and Performance IssuesSpark Overview and Performance Issues
Spark Overview and Performance Issues
 
Yarn
YarnYarn
Yarn
 
Hadoop deconstructing map reduce job step by step
Hadoop deconstructing map reduce job step by stepHadoop deconstructing map reduce job step by step
Hadoop deconstructing map reduce job step by step
 
Strata + Hadoop World 2012: Knitting Boar
Strata + Hadoop World 2012: Knitting BoarStrata + Hadoop World 2012: Knitting Boar
Strata + Hadoop World 2012: Knitting Boar
 
Hadoop fault-tolerance
Hadoop fault-toleranceHadoop fault-tolerance
Hadoop fault-tolerance
 
Data Analytics and IoT, how to analyze data from IoT
Data Analytics and IoT, how to analyze data from IoTData Analytics and IoT, how to analyze data from IoT
Data Analytics and IoT, how to analyze data from IoT
 
Hadoop map reduce v2
Hadoop map reduce v2Hadoop map reduce v2
Hadoop map reduce v2
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

Anatomy of Hadoop YARN

  • 1.
  • 2. What is YARN? • YARN stands for Yet Another Resource Negotiator. It’s a framework introduced in 2010 by a group ay Yahoo!. This is considered as next generation of MapReduce. YARN is not specific for MapReduce. It can be used for running any application. Why YARN? • In a Hadoop cluster which has more than 4000 nodes, Classic MapReduce hit scalability bottlenecks. This is because JobTracker does too many things like job scheduling, monitoring task progress by keeping track of tasks, restarting failed or slow tasks and doing task bookkeeping (like managing counter totals). How YARN solves the problem? • The problem is solved by splitting the responsibility of JobTracker (in Classic MapReduce) to different components. Because of which, there are more entities involved in YARN (compared to Classic MR). The entities in YARN are as follows; • Client: which submits the MapReduce job • Resource Manager: which manages the use of resources across the cluster. It creates new containers for Map and Reduce processes. • Node Manager: In every new container created by Resource Manager, a Node Manager process will be run which oversees the containers running on the cluster nodes. It doesn’t matter if the container is created for Map or Reduce or any other process. Node Manager ensures that the application does not use more resources than what it is allocated with. • Application Master: which negotiates with the Resource Manager for resources and runs the application-specific process (Map or Reduce tasks) in those clusters. The Application Master & the MapReduce tasks run in containers that are scheduled by the resource manager and managed by the node manager. • HDFS How to activate YARN? • By setting the property ‘mapreduce.framework.name’ to ‘yarn’, the YARN framework will be activated. From then on when a Job is submitted, YARN framework will be used to execute the Job.
  • 3. FIRST A JOB HAS TO BE SUBMITTED TO HADOOP CLUSTER. LET’S SEE HOW JOB SUBMISSION HAPPENS IN CASE OF YARN.
  • 4. MR Program Job Client JVM ResourceManager HDFS Folder in name of Application ID getNewApplicationId() submit() submitApplication() Job Jar Configuration Files Computed Input Splits Resource Manager node • Job submission in YARN is very similar to Classic MapReduce. In YARN its not called as Job instead its called as Application. • Client calls the submit() (or waitForCompletion()) method on Job. • The Job.submit() does the following; • A new application ID is retrieved from Resource Manager. • Checks the input and output specification. • Computes input slits. • Creates a directory in the name of Application ID in HDFS. • Copies Job jar, configuration files and computed input splits to this directory. • Informs the Resource manager by executing the submitApplication() on the Resource manager.
  • 5. NEXT THE SUBMITTED JOB WILL BE INITIALIZED. NOW LET’S SEE HOW JOB INITIALIZATION HAPPENS IN YARN.
  • 6. • ResourceManager.submitApplication() method hands over the job to scheduler. • Scheduler creates a new Container. • All containers in YARN will have an instance of NodeManager running in it, which manages the actual process which is scheduled to run in the container. • The actual process in this case is an application master. For a MR Job, the main class for an application master is ‘MRAppMaster’. • MRAppMaster initilizes the job by creating number of bookkeeping objects to track the job’s progress as it receives progress & completion reports from the tasks. • Next the MRAppMaster retrieves input splits from HDFS. ResourceManag er submitApplication( ) Scheduler HDFS Map Tasks Reduce Tasks Other Tasks Bookkeeping Info Input Splits stored in Job ID directory in HDFS. T1 T2 T3 T1 J S J CS 1 S 2 S 3 • Now application master, creates one map task per split and it checks the ‘mapreduce.job.reduces’ property & creates those many number of reducers. Container NodeManager Application Master MRAppMaster
  • 7. • At this point, application master knows how big the job is and it decides if it can execute the job in the same JVM as itself or should it run each of these tasks parallel in different containers. Such small jobs are said to be uberized or run as uber task. • This decision is made by the application master based on the following property configurations; • mapreduce.job.ubertask.maxmaps • mapreduce.job.ubertask.maxreduces • mapreduce.job.ubertask.maxbytes • mapreduce.job.ubertask.enable • Before any task can run, application master executes the job setup methods to create job’s output directory.
  • 8. IF THE JOB IS NOT RUN AS UBER TASK, THEN APPLICATION MASTER REQUESTS CONTAINERS FOR ALL MAP AND REDUCE TASK. THIS PROCESS IS CALLED TASK ASSIGNMENT. NOW LET’S SEE HOW TASK ASSIGNMENT HAPPENS IN YARN.
  • 9. • Application master sends heartbeat signal to Resource Manager every few seconds. Application Master uses this signal to request containers for Map and Reduce tasks. Resource Manager Application Master sends a heartbeat signal with request for map and reduce tasks • The container request includes information about map task’s data locality i.e., host and rack in which the split resides. • Unlike MR 1, where there are fixed number of slots and fixed amount of resources allocated, YARN is pretty flexible in resource allocation. The request (which is sent along with the heartbeat signal) for container can include a request for amount of memory needed for the task. The default for map and reduce task is 1024 MB. • Scheduler uses this information to make scheduling decisions. Scheduler tries to do a local placement. If not possible, it tried for rack-local placement. Else non-local placement. Refer : Replica placement slide. Container NodeManager MRAppMaster • Once the Resource Manager gets this request, it creates a new container and starts Node Manager instance in it to manage the Map or Reduce task for which the container was created for. It also ensures that the requested amount of resources are allocated to the
  • 10. NOW TASKS ARE ASSIGNED TO CONTAINER WHICH FOLLOWS A SERIES OF STEPS TO EXECUTE A TASK. LET’S SEE HOW TASKS ARE EXECUTED IN A YARN CONTAINER.
  • 11. Distributed Cache HDFS Folder created in container’s local. • Application Master starts a container through the Node Manager running in the other container.`• Node Manager (in the other container) spawns a new JVM process and launches a new Java application called ‘YarnChild’. The reason for a new JVM process is same as MR 1. And YARN doesn’t support JVM reuse. • The work of YarnChild is to execute the actual process (Map or Reduce). • First YarnChild tries to localize the resources like Job jar, configuration files and supporting files from Distribute Cache. • Once the resources are localized, YarnChild begins executing the Map or Reduce task. Container NodeManager Container NodeManager MRAppMaster JVM Process YarnChild Map/Reduce Task Un-jar the job jar contents
  • 12. SINCE TASKS ARE EXECUTED IN A DISTRIBUTED ENVIRONMENT, TRACKING THE PROGRESS AND STATUS OF JOB IS TRICKY. LET’S SEE HOW PROGRESS AND STATUS UPDATES ARE TAKEN CARE IN YARN.
  • 13. • Clients poll the Application master every second to receive the progress updates. This can be configured using the property mapreduce.client.progressmonitor.pollinterval. • The Application Master then aggregates this to build the overall job progress. • The task sends its progress and counters are sent to Application Master once in three seconds. Container NodeManager Container NodeManager MRAppMaster JVM Process YarnChild Map/Reduce Task Client Node Job getStatus() MapReduce Program Job: SFO Crime Job Status: Running Task & task status • The Application Master Web UI displays all the running applications with links to the web Uis of respective application masters, each of which displays further details on the MR job, including its progress.
  • 14. THIS EXECUTION PROCESS CONTINUES TILL ALL THE TASKS ARE COMPLETED. ONCE THE LAST TASK IS COMPLETED, MR FRAMEWORK ENTERS THE LAST PHASE CALLED JOB COMPLETION.
  • 15. • When the job is completed, the application master and task containers clean up their working state, and the OutputCommiter’s job cleanup method is executed. • If the property ‘job.end.notification.url’ is set, the Job Tracker will send a HTTP job notification to the client. • Job information is archived by the job history server to enable later interrogation by users if desired.
  • 16. THE END PLEASE SEND YOUR VALUABLE FEEDBACK TO RAJESH_1290K@YAHOO.COM