SlideShare a Scribd company logo
Apache Hadoop YARN: The Next-
generation Distributed Operating
System
Zhijie Shen & Jian He @ Hortonworks
About Us
● Two hats
o Software Engineer @ Hortonworks, Inc.
o Hadoop Committer @ The Apache Foundation
● We’re doing Apache YARN!
Agenda
● What Is YARN
● YARN Basics
● Recent Development
● Writing Your YARN Applications
What is YARN (1)
Frequent questions on mailing list:
● What is Hadoop 2.0?
● What is YARN?
Hadoop 2.0
= YARN
= the operating systems to run various
distributed data processing applications
What is YARN (2) - Motivation
● Hadoop is 8yr old
● World is significantly changed
o The hardware
o diverse data processing model: interaction,
streaming
What is YARN (3) - Motivation
Flexibility - Enabling data processing model
more than MapReduce
What is YARN (5) - Motivation
● Scalability - Splitting
resource management
and job life cycle
management and
mointoring
● Efficiency - Improve
cluster utilization
o distinct map/reduce
slots on a host
What Is YARN (4) - Motivation
● Resource Sharing - Multiple workloads in
cluster
What Is YARN (5) - Status
● YARN is shipped
● YARN is going to be better
● Hadoop 2.4 is coming this month!
● ResourceManager high availability
● Application historic data services
● Long-running applications optimization
What Is YARN (6) - Status
YARN ecosystem
What is YARN (7) - Status
YARN community
Active committers working on YARN 10+
Active other contributors 20+
Total Jira tickets 1800+
Jira tickets that are resolved/closed 1100+
Agenda
● What Is YARN
● YARN Basics
● Recent Development
● Writing Your YARN Applications
YARN Basics (1) - Concept
● ResourceManager -
Master of a cluster
● NodeManager - Slave
to take care of one host
● ApplicationMaster -
Master of an application
● Container - Resource
abstraction, process to
complete a task
YARN Basics (2) - RM
Component interfacing RM to the
clients:
● ClientRMService
Component interacting with the
per-application AMs:
● ApplicationMasterService
Component connecting RM to the
nodes:
● ResourceTrackerService
Core of the ResourceManager
● Scheduler, managing apps
YARN Basics (3) - NM
Component for NM-RM
communication:
● NodeStatusUpdater
Core component managing
containers on the node:
● ContainerManager
Component interacting with OS to
start/stop the container process:
● ContainerExecutor
YARN Basics (4) - Workflow
Execution Sequence:
1. Client submits an application
2. RM allocates a container to start AM
3. AM registers with RM
4. AM asks containers from RM
5. AM notifies NM to launch containers
6. Application code is executed in
container
7. Client contacts RM/AM to monitor
application’s status
8. AM unregisters with RM
Client RM NM AM
1
2
3
4
5
7
8
6
YARN Basics (5) - Scheduler
● FIFO
Simply first come, first serve
● Fair
o evenly share the resource across queues, among
applications
● Capacity
o allowing certain resource capacity to queues
Agenda
● What Is YARN
● YARN Basics
● Recent Development
● Writing Your YARN Applications
Apache Hadoop release
● Hadoop 2.4 is coming out very soon
● ResourceManager high availability
o RM Restart
o RM failover
● Application Historic Data Service
o MRv1 JobHisotoryServer.
ResourceManager High Availability
● RM is potentially a single point of failure.
o Restart for various reasons: Bugs, hardware failures, deliberate down-
time for upgrades
● Goal: RM down-time invisible to end-users.
● Includes two parts:
o RM Restart
o RM Failover
ResourceManager Restart
● RMState includes:
o static state (appSubmissionContext, credentials) , belongs to RM
o running state - per AM
 scheduler state, i.e. per-app scheduling state, resource
consumptions
● Overly complex in MRv1 for the fact that JobTracker has to save too much
information: both static state and running state.
● YARN RM only persists static state, because AM and RM are running on
different machines on YARN
o Persist application submission metadata and gathers running state
from AM and NM
ResourceManager FailOver
● Active/Standby
o Leader election
(ZooKeeper)
● Standby on transition to
Active loads all the state
from the state store.
● NM, AM, clients, redirect
to the new RM
o RMProxy
Application Historic Data Service
● Motivation: MRv1 JobHisotoryServer
o MR job writes history data into HDFS.
o When job finishes and removes from memory, Clients request will be
redirected to JHS.
o Reads the this persistent history data in a on-demand way to serve
the requests.
Application Historic Data Service
● Goal: Solve the application-history problem in a generic
and more scalable way.
● A single application history server to serve all
applications’ requests.
● ResourceManager records generic application information
o Application, ApplicationAttempt, Container
● ApplicationMaster writes framework specific information
o Free for users to define
● Multiple interfaces to inquiry the historic information
o RPC, RESTful Services
o History server Web UI
Application Historic Server
Long Running Service(YARN-896)
● YARN is intended to be generic purpose.
o Short-lived (e.g.MR) apps vs long-lived apps
● Goal: disruptive impact minimum to running
applications.
o Work-preserving AM restart.
 Single point of failure for application’s point of view
 Not killing containers
 AM rebind with previous running containers.
o Work-preserving NM restart.
 containers process
 Previous running containers rebind with new NM.
Agenda
● What Is YARN
● YARN Basics
● Recent Development
● Writing Your YARN Applications
Write a Yarn Applicaition
Write client and AM
Client
● Client – RM --- YarnClient
o submitApplication
ApplicationMaster
● AM – RM --- AMRMClient
o registerApplicationMaster
o allocate
o finishApplicationMaster
● AM – NM --- NMClient
o startContainer
o getContainerStatus
o stopContainer
Writing the YarnClient
1. Get the application Id from RM
1. Construct ApplicationSubmissionContext
a. Shell command to run the AM
b. Environment (class path, env-variable)
c. LocalResources (Job jars downloaded from HDFS)
1. Submit the request to RM
a. submitApplication
Example: client submit an application
1. YarnClient yarnClient = YarnClient.createYarnClient();
1. YarnClientApplication app = yarnClient.createApplication();
1. appContext = app.getAppSubmissionContext()
…….client logic …..
set command: "$JAVA_HOME/bin/java" + "ApplicationMaster" + command
set environments: class path etc.
set jars:
…………………………..
1. yarnClient.submitApplication(appContext);
Writing ApplicationMaster
● The ApplicationMaster is started.
● In AM code, for each task, to start the container, we
repeat a similar procedure as starting the master.
o construct ContainerLaunchContext
 commands
 env
 jars
Writing ApplicationMaster
1. AM registers with RM (registerApplicationMaster)
1. HeartBeats(allocate) with RM (asynchronously)
a. send the Request
i. Request new containers.
ii. Release containers.
b. Received containers and send request to NM to start the
container
1. Unregisters with RM (finishApplicationMaster)
Writing ApplicationMaster
● RM assigns containers asynchronously
● Containers are likely not returned immediately at current
call.
● User needs to give empty requests until it gets the
containers it requested.
● ResourceRequest is incremental.
ContainerManagementProtocol
1. Start container (task) on NM
a. startContainer
1. Monitor the container(task) status
a. getContainerStatus
1. Stop the the container (task)
a. stopContainer
Example - AM: request containers
AMRMClient rmClient = AMRMClient.createAMRMClient();
ContainerRequest containerAsk = new ContainerRequest(capability)
rmClient.addContainerRequest(containerAsk);
Wait until get the containers:
do {
AllocateResponse response = rmClient.allocate(0);
Thread.sleep(100);
} while (response.getAllocatedContainers().size() > 0)
Example - AM: start/stop containers
NMClient nmClient = NMClient.createNMClient();
for (Container container : response.getAllocatedContainers()) {
ContainerLaunchContext ctx =
ContainerLaunchContext.newInstace();
ctx.setCommands(command);
ctx.setEnvironment(envs);
nmClient.startContainer(container, ctx);
}
-monitor container: nmClient.getContainerStatus(containerId)
-stop container: nmClient.stopContainer(ContainerId)
Takeaway
1. YARN is a resource-management platform that can host different data-
processing frameworks (beyond MapReduce).
o No longer limited by MR, (batch process, interactive query, stream)
o All applications can now co-exist and share the same data on HDFS.
1. YARN is in production now.
o Yahoo, Ebay.
1. We welcome your contributions.
o patches, tests, writing applications on YARN
o https://issues.apache.org/jira/browse/YARN
o https://github.com/hortonworks/simple-yarn-app
The book is out !
http://yarn-book.com/
http://yarn-book.com/
ApacheCon North America 2014 - Apache Hadoop YARN: The Next-generation Distributed Operating System

More Related Content

What's hot

Productionalizing Spark ML
Productionalizing Spark MLProductionalizing Spark ML
Productionalizing Spark ML
datamantra
 
Structured Streaming with Kafka
Structured Streaming with KafkaStructured Streaming with Kafka
Structured Streaming with Kafka
datamantra
 
Stateful streaming and the challenge of state
Stateful streaming and the challenge of stateStateful streaming and the challenge of state
Stateful streaming and the challenge of state
Yoni Farin
 
Hadoop YARN Services
Hadoop YARN ServicesHadoop YARN Services
Hadoop YARN Services
DataWorks Summit
 
Real time data pipline with kafka streams
Real time data pipline with kafka streamsReal time data pipline with kafka streams
Real time data pipline with kafka streams
Yoni Farin
 
REEF: Towards a Big Data Stdlib
REEF: Towards a Big Data StdlibREEF: Towards a Big Data Stdlib
REEF: Towards a Big Data StdlibDataWorks Summit
 
Introduction to Datasource V2 API
Introduction to Datasource V2 APIIntroduction to Datasource V2 API
Introduction to Datasource V2 API
datamantra
 
Core Services behind Spark Job Execution
Core Services behind Spark Job ExecutionCore Services behind Spark Job Execution
Core Services behind Spark Job Execution
datamantra
 
Harnessing the power of YARN with Apache Twill
Harnessing the power of YARN with Apache TwillHarnessing the power of YARN with Apache Twill
Harnessing the power of YARN with Apache Twill
Terence Yim
 
Spark on Kubernetes
Spark on KubernetesSpark on Kubernetes
Spark on Kubernetes
datamantra
 
Introduction to Structured streaming
Introduction to Structured streamingIntroduction to Structured streaming
Introduction to Structured streaming
datamantra
 
Introduction to concurrent programming with Akka actors
Introduction to concurrent programming with Akka actorsIntroduction to concurrent programming with Akka actors
Introduction to concurrent programming with Akka actors
Shashank L
 
Kafka zero to hero
Kafka zero to heroKafka zero to hero
Kafka zero to hero
Avi Levi
 
Reactive mistakes reactive nyc
Reactive mistakes   reactive nycReactive mistakes   reactive nyc
Reactive mistakes reactive nyc
Petr Zapletal
 
Building real time Data Pipeline using Spark Streaming
Building real time Data Pipeline using Spark StreamingBuilding real time Data Pipeline using Spark Streaming
Building real time Data Pipeline using Spark Streaming
datamantra
 
Spark Streaming Recipes and "Exactly Once" Semantics Revised
Spark Streaming Recipes and "Exactly Once" Semantics RevisedSpark Streaming Recipes and "Exactly Once" Semantics Revised
Spark Streaming Recipes and "Exactly Once" Semantics Revised
Michael Spector
 
Introduction to Spark Streaming
Introduction to Spark StreamingIntroduction to Spark Streaming
Introduction to Spark Streaming
Knoldus Inc.
 
Apache Samza - New features in the upcoming Samza release 0.10.0
Apache Samza - New features in the upcoming Samza release 0.10.0Apache Samza - New features in the upcoming Samza release 0.10.0
Apache Samza - New features in the upcoming Samza release 0.10.0
Navina Ramesh
 
Migrating to spark 2.0
Migrating to spark 2.0Migrating to spark 2.0
Migrating to spark 2.0
datamantra
 
Apache Spark Internals
Apache Spark InternalsApache Spark Internals
Apache Spark Internals
Knoldus Inc.
 

What's hot (20)

Productionalizing Spark ML
Productionalizing Spark MLProductionalizing Spark ML
Productionalizing Spark ML
 
Structured Streaming with Kafka
Structured Streaming with KafkaStructured Streaming with Kafka
Structured Streaming with Kafka
 
Stateful streaming and the challenge of state
Stateful streaming and the challenge of stateStateful streaming and the challenge of state
Stateful streaming and the challenge of state
 
Hadoop YARN Services
Hadoop YARN ServicesHadoop YARN Services
Hadoop YARN Services
 
Real time data pipline with kafka streams
Real time data pipline with kafka streamsReal time data pipline with kafka streams
Real time data pipline with kafka streams
 
REEF: Towards a Big Data Stdlib
REEF: Towards a Big Data StdlibREEF: Towards a Big Data Stdlib
REEF: Towards a Big Data Stdlib
 
Introduction to Datasource V2 API
Introduction to Datasource V2 APIIntroduction to Datasource V2 API
Introduction to Datasource V2 API
 
Core Services behind Spark Job Execution
Core Services behind Spark Job ExecutionCore Services behind Spark Job Execution
Core Services behind Spark Job Execution
 
Harnessing the power of YARN with Apache Twill
Harnessing the power of YARN with Apache TwillHarnessing the power of YARN with Apache Twill
Harnessing the power of YARN with Apache Twill
 
Spark on Kubernetes
Spark on KubernetesSpark on Kubernetes
Spark on Kubernetes
 
Introduction to Structured streaming
Introduction to Structured streamingIntroduction to Structured streaming
Introduction to Structured streaming
 
Introduction to concurrent programming with Akka actors
Introduction to concurrent programming with Akka actorsIntroduction to concurrent programming with Akka actors
Introduction to concurrent programming with Akka actors
 
Kafka zero to hero
Kafka zero to heroKafka zero to hero
Kafka zero to hero
 
Reactive mistakes reactive nyc
Reactive mistakes   reactive nycReactive mistakes   reactive nyc
Reactive mistakes reactive nyc
 
Building real time Data Pipeline using Spark Streaming
Building real time Data Pipeline using Spark StreamingBuilding real time Data Pipeline using Spark Streaming
Building real time Data Pipeline using Spark Streaming
 
Spark Streaming Recipes and "Exactly Once" Semantics Revised
Spark Streaming Recipes and "Exactly Once" Semantics RevisedSpark Streaming Recipes and "Exactly Once" Semantics Revised
Spark Streaming Recipes and "Exactly Once" Semantics Revised
 
Introduction to Spark Streaming
Introduction to Spark StreamingIntroduction to Spark Streaming
Introduction to Spark Streaming
 
Apache Samza - New features in the upcoming Samza release 0.10.0
Apache Samza - New features in the upcoming Samza release 0.10.0Apache Samza - New features in the upcoming Samza release 0.10.0
Apache Samza - New features in the upcoming Samza release 0.10.0
 
Migrating to spark 2.0
Migrating to spark 2.0Migrating to spark 2.0
Migrating to spark 2.0
 
Apache Spark Internals
Apache Spark InternalsApache Spark Internals
Apache Spark Internals
 

Viewers also liked

Introduction to Big Data and Hadoop
Introduction to Big Data and HadoopIntroduction to Big Data and Hadoop
Introduction to Big Data and Hadoop
Edureka!
 
Apache Hadoop YARN
Apache Hadoop YARNApache Hadoop YARN
Apache Hadoop YARN
Adam Kawa
 
Apache Hadoop YARN: best practices
Apache Hadoop YARN: best practicesApache Hadoop YARN: best practices
Apache Hadoop YARN: best practicesDataWorks Summit
 
Apache Hadoop YARN: Understanding the Data Operating System of Hadoop
Apache Hadoop YARN: Understanding the Data Operating System of HadoopApache Hadoop YARN: Understanding the Data Operating System of Hadoop
Apache Hadoop YARN: Understanding the Data Operating System of Hadoop
Hortonworks
 
Apache Hadoop YARN - Enabling Next Generation Data Applications
Apache Hadoop YARN - Enabling Next Generation Data ApplicationsApache Hadoop YARN - Enabling Next Generation Data Applications
Apache Hadoop YARN - Enabling Next Generation Data Applications
Hortonworks
 
Introduction to YARN and MapReduce 2
Introduction to YARN and MapReduce 2Introduction to YARN and MapReduce 2
Introduction to YARN and MapReduce 2
Cloudera, Inc.
 

Viewers also liked (6)

Introduction to Big Data and Hadoop
Introduction to Big Data and HadoopIntroduction to Big Data and Hadoop
Introduction to Big Data and Hadoop
 
Apache Hadoop YARN
Apache Hadoop YARNApache Hadoop YARN
Apache Hadoop YARN
 
Apache Hadoop YARN: best practices
Apache Hadoop YARN: best practicesApache Hadoop YARN: best practices
Apache Hadoop YARN: best practices
 
Apache Hadoop YARN: Understanding the Data Operating System of Hadoop
Apache Hadoop YARN: Understanding the Data Operating System of HadoopApache Hadoop YARN: Understanding the Data Operating System of Hadoop
Apache Hadoop YARN: Understanding the Data Operating System of Hadoop
 
Apache Hadoop YARN - Enabling Next Generation Data Applications
Apache Hadoop YARN - Enabling Next Generation Data ApplicationsApache Hadoop YARN - Enabling Next Generation Data Applications
Apache Hadoop YARN - Enabling Next Generation Data Applications
 
Introduction to YARN and MapReduce 2
Introduction to YARN and MapReduce 2Introduction to YARN and MapReduce 2
Introduction to YARN and MapReduce 2
 

Similar to ApacheCon North America 2014 - Apache Hadoop YARN: The Next-generation Distributed Operating System

Understanding yarn - Pune apex meetup jan 06 2016
Understanding yarn - Pune apex meetup jan 06 2016 Understanding yarn - Pune apex meetup jan 06 2016
Understanding yarn - Pune apex meetup jan 06 2016
Priyanka Gugale
 
Spark on yarn
Spark on yarnSpark on yarn
Spark on yarn
datamantra
 
Introduction to Yarn
Introduction to YarnIntroduction to Yarn
Introduction to Yarn
Omid Vahdaty
 
Introduction to Yarn
Introduction to YarnIntroduction to Yarn
Introduction to Yarn
Apache Apex
 
Venturing into Hadoop Large Clusters
Venturing into Hadoop Large ClustersVenturing into Hadoop Large Clusters
Venturing into Hadoop Large Clusters
VARUN SAXENA
 
Venturing into Large Hadoop Clusters
Venturing into Large Hadoop ClustersVenturing into Large Hadoop Clusters
Venturing into Large Hadoop Clusters
Naganarasimha Garla
 
Introduction to yarn
Introduction to yarnIntroduction to yarn
Introduction to yarn
Bhupesh Chawda
 
Developing YARN Applications - Integrating natively to YARN July 24 2014
Developing YARN Applications - Integrating natively to YARN July 24 2014Developing YARN Applications - Integrating natively to YARN July 24 2014
Developing YARN Applications - Integrating natively to YARN July 24 2014Hortonworks
 
Intro to YARN (Hadoop 2.0) & Apex as YARN App (Next Gen Big Data)
Intro to YARN (Hadoop 2.0) & Apex as YARN App (Next Gen Big Data)Intro to YARN (Hadoop 2.0) & Apex as YARN App (Next Gen Big Data)
Intro to YARN (Hadoop 2.0) & Apex as YARN App (Next Gen Big Data)
Apache Apex
 
Yarn
YarnYarn
[db tech showcase Tokyo 2014] C32: Hadoop最前線 - 開発の現場から by NTT 小沢健史
[db tech showcase Tokyo 2014] C32: Hadoop最前線 - 開発の現場から  by NTT 小沢健史[db tech showcase Tokyo 2014] C32: Hadoop最前線 - 開発の現場から  by NTT 小沢健史
[db tech showcase Tokyo 2014] C32: Hadoop最前線 - 開発の現場から by NTT 小沢健史
Insight Technology, Inc.
 
Running Services on YARN
Running Services on YARNRunning Services on YARN
Running Services on YARN
DataWorks Summit/Hadoop Summit
 
Running Non-MapReduce Big Data Applications on Apache Hadoop
Running Non-MapReduce Big Data Applications on Apache HadoopRunning Non-MapReduce Big Data Applications on Apache Hadoop
Running Non-MapReduce Big Data Applications on Apache Hadoop
hitesh1892
 
Venturing into Large Hadoop Clusters
Venturing into Large Hadoop ClustersVenturing into Large Hadoop Clusters
Venturing into Large Hadoop Clusters
VARUN SAXENA
 
Application Timeline Server - Past, Present and Future
Application Timeline Server - Past, Present and FutureApplication Timeline Server - Past, Present and Future
Application Timeline Server - Past, Present and Future
VARUN SAXENA
 
Writing YARN Applications Hadoop Summit 2012
Writing YARN Applications Hadoop Summit 2012Writing YARN Applications Hadoop Summit 2012
Writing YARN Applications Hadoop Summit 2012
hitesh1892
 
Writing Yarn Applications Hadoop Summit 2012
Writing Yarn Applications Hadoop Summit 2012Writing Yarn Applications Hadoop Summit 2012
Writing Yarn Applications Hadoop Summit 2012
Hortonworks
 
Introduction to YARN Apps
Introduction to YARN AppsIntroduction to YARN Apps
Introduction to YARN Apps
Cloudera, Inc.
 
Session 02 - Yarn Concepts
Session 02 - Yarn ConceptsSession 02 - Yarn Concepts
Session 02 - Yarn Concepts
AnandMHadoop
 
Overview of slider project
Overview of slider projectOverview of slider project
Overview of slider project
Steve Loughran
 

Similar to ApacheCon North America 2014 - Apache Hadoop YARN: The Next-generation Distributed Operating System (20)

Understanding yarn - Pune apex meetup jan 06 2016
Understanding yarn - Pune apex meetup jan 06 2016 Understanding yarn - Pune apex meetup jan 06 2016
Understanding yarn - Pune apex meetup jan 06 2016
 
Spark on yarn
Spark on yarnSpark on yarn
Spark on yarn
 
Introduction to Yarn
Introduction to YarnIntroduction to Yarn
Introduction to Yarn
 
Introduction to Yarn
Introduction to YarnIntroduction to Yarn
Introduction to Yarn
 
Venturing into Hadoop Large Clusters
Venturing into Hadoop Large ClustersVenturing into Hadoop Large Clusters
Venturing into Hadoop Large Clusters
 
Venturing into Large Hadoop Clusters
Venturing into Large Hadoop ClustersVenturing into Large Hadoop Clusters
Venturing into Large Hadoop Clusters
 
Introduction to yarn
Introduction to yarnIntroduction to yarn
Introduction to yarn
 
Developing YARN Applications - Integrating natively to YARN July 24 2014
Developing YARN Applications - Integrating natively to YARN July 24 2014Developing YARN Applications - Integrating natively to YARN July 24 2014
Developing YARN Applications - Integrating natively to YARN July 24 2014
 
Intro to YARN (Hadoop 2.0) & Apex as YARN App (Next Gen Big Data)
Intro to YARN (Hadoop 2.0) & Apex as YARN App (Next Gen Big Data)Intro to YARN (Hadoop 2.0) & Apex as YARN App (Next Gen Big Data)
Intro to YARN (Hadoop 2.0) & Apex as YARN App (Next Gen Big Data)
 
Yarn
YarnYarn
Yarn
 
[db tech showcase Tokyo 2014] C32: Hadoop最前線 - 開発の現場から by NTT 小沢健史
[db tech showcase Tokyo 2014] C32: Hadoop最前線 - 開発の現場から  by NTT 小沢健史[db tech showcase Tokyo 2014] C32: Hadoop最前線 - 開発の現場から  by NTT 小沢健史
[db tech showcase Tokyo 2014] C32: Hadoop最前線 - 開発の現場から by NTT 小沢健史
 
Running Services on YARN
Running Services on YARNRunning Services on YARN
Running Services on YARN
 
Running Non-MapReduce Big Data Applications on Apache Hadoop
Running Non-MapReduce Big Data Applications on Apache HadoopRunning Non-MapReduce Big Data Applications on Apache Hadoop
Running Non-MapReduce Big Data Applications on Apache Hadoop
 
Venturing into Large Hadoop Clusters
Venturing into Large Hadoop ClustersVenturing into Large Hadoop Clusters
Venturing into Large Hadoop Clusters
 
Application Timeline Server - Past, Present and Future
Application Timeline Server - Past, Present and FutureApplication Timeline Server - Past, Present and Future
Application Timeline Server - Past, Present and Future
 
Writing YARN Applications Hadoop Summit 2012
Writing YARN Applications Hadoop Summit 2012Writing YARN Applications Hadoop Summit 2012
Writing YARN Applications Hadoop Summit 2012
 
Writing Yarn Applications Hadoop Summit 2012
Writing Yarn Applications Hadoop Summit 2012Writing Yarn Applications Hadoop Summit 2012
Writing Yarn Applications Hadoop Summit 2012
 
Introduction to YARN Apps
Introduction to YARN AppsIntroduction to YARN Apps
Introduction to YARN Apps
 
Session 02 - Yarn Concepts
Session 02 - Yarn ConceptsSession 02 - Yarn Concepts
Session 02 - Yarn Concepts
 
Overview of slider project
Overview of slider projectOverview of slider project
Overview of slider project
 

Recently uploaded

From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 

Recently uploaded (20)

From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 

ApacheCon North America 2014 - Apache Hadoop YARN: The Next-generation Distributed Operating System

  • 1. Apache Hadoop YARN: The Next- generation Distributed Operating System Zhijie Shen & Jian He @ Hortonworks
  • 2. About Us ● Two hats o Software Engineer @ Hortonworks, Inc. o Hadoop Committer @ The Apache Foundation ● We’re doing Apache YARN!
  • 3. Agenda ● What Is YARN ● YARN Basics ● Recent Development ● Writing Your YARN Applications
  • 4. What is YARN (1) Frequent questions on mailing list: ● What is Hadoop 2.0? ● What is YARN? Hadoop 2.0 = YARN = the operating systems to run various distributed data processing applications
  • 5. What is YARN (2) - Motivation ● Hadoop is 8yr old ● World is significantly changed o The hardware o diverse data processing model: interaction, streaming
  • 6. What is YARN (3) - Motivation Flexibility - Enabling data processing model more than MapReduce
  • 7. What is YARN (5) - Motivation ● Scalability - Splitting resource management and job life cycle management and mointoring ● Efficiency - Improve cluster utilization o distinct map/reduce slots on a host
  • 8. What Is YARN (4) - Motivation ● Resource Sharing - Multiple workloads in cluster
  • 9. What Is YARN (5) - Status ● YARN is shipped ● YARN is going to be better ● Hadoop 2.4 is coming this month! ● ResourceManager high availability ● Application historic data services ● Long-running applications optimization
  • 10. What Is YARN (6) - Status YARN ecosystem
  • 11. What is YARN (7) - Status YARN community Active committers working on YARN 10+ Active other contributors 20+ Total Jira tickets 1800+ Jira tickets that are resolved/closed 1100+
  • 12. Agenda ● What Is YARN ● YARN Basics ● Recent Development ● Writing Your YARN Applications
  • 13. YARN Basics (1) - Concept ● ResourceManager - Master of a cluster ● NodeManager - Slave to take care of one host ● ApplicationMaster - Master of an application ● Container - Resource abstraction, process to complete a task
  • 14. YARN Basics (2) - RM Component interfacing RM to the clients: ● ClientRMService Component interacting with the per-application AMs: ● ApplicationMasterService Component connecting RM to the nodes: ● ResourceTrackerService Core of the ResourceManager ● Scheduler, managing apps
  • 15. YARN Basics (3) - NM Component for NM-RM communication: ● NodeStatusUpdater Core component managing containers on the node: ● ContainerManager Component interacting with OS to start/stop the container process: ● ContainerExecutor
  • 16. YARN Basics (4) - Workflow Execution Sequence: 1. Client submits an application 2. RM allocates a container to start AM 3. AM registers with RM 4. AM asks containers from RM 5. AM notifies NM to launch containers 6. Application code is executed in container 7. Client contacts RM/AM to monitor application’s status 8. AM unregisters with RM Client RM NM AM 1 2 3 4 5 7 8 6
  • 17. YARN Basics (5) - Scheduler ● FIFO Simply first come, first serve ● Fair o evenly share the resource across queues, among applications ● Capacity o allowing certain resource capacity to queues
  • 18. Agenda ● What Is YARN ● YARN Basics ● Recent Development ● Writing Your YARN Applications
  • 19. Apache Hadoop release ● Hadoop 2.4 is coming out very soon ● ResourceManager high availability o RM Restart o RM failover ● Application Historic Data Service o MRv1 JobHisotoryServer.
  • 20. ResourceManager High Availability ● RM is potentially a single point of failure. o Restart for various reasons: Bugs, hardware failures, deliberate down- time for upgrades ● Goal: RM down-time invisible to end-users. ● Includes two parts: o RM Restart o RM Failover
  • 21. ResourceManager Restart ● RMState includes: o static state (appSubmissionContext, credentials) , belongs to RM o running state - per AM  scheduler state, i.e. per-app scheduling state, resource consumptions ● Overly complex in MRv1 for the fact that JobTracker has to save too much information: both static state and running state. ● YARN RM only persists static state, because AM and RM are running on different machines on YARN o Persist application submission metadata and gathers running state from AM and NM
  • 22. ResourceManager FailOver ● Active/Standby o Leader election (ZooKeeper) ● Standby on transition to Active loads all the state from the state store. ● NM, AM, clients, redirect to the new RM o RMProxy
  • 23. Application Historic Data Service ● Motivation: MRv1 JobHisotoryServer o MR job writes history data into HDFS. o When job finishes and removes from memory, Clients request will be redirected to JHS. o Reads the this persistent history data in a on-demand way to serve the requests.
  • 24. Application Historic Data Service ● Goal: Solve the application-history problem in a generic and more scalable way. ● A single application history server to serve all applications’ requests. ● ResourceManager records generic application information o Application, ApplicationAttempt, Container ● ApplicationMaster writes framework specific information o Free for users to define ● Multiple interfaces to inquiry the historic information o RPC, RESTful Services o History server Web UI
  • 26. Long Running Service(YARN-896) ● YARN is intended to be generic purpose. o Short-lived (e.g.MR) apps vs long-lived apps ● Goal: disruptive impact minimum to running applications. o Work-preserving AM restart.  Single point of failure for application’s point of view  Not killing containers  AM rebind with previous running containers. o Work-preserving NM restart.  containers process  Previous running containers rebind with new NM.
  • 27. Agenda ● What Is YARN ● YARN Basics ● Recent Development ● Writing Your YARN Applications
  • 28. Write a Yarn Applicaition
  • 29. Write client and AM Client ● Client – RM --- YarnClient o submitApplication ApplicationMaster ● AM – RM --- AMRMClient o registerApplicationMaster o allocate o finishApplicationMaster ● AM – NM --- NMClient o startContainer o getContainerStatus o stopContainer
  • 30. Writing the YarnClient 1. Get the application Id from RM 1. Construct ApplicationSubmissionContext a. Shell command to run the AM b. Environment (class path, env-variable) c. LocalResources (Job jars downloaded from HDFS) 1. Submit the request to RM a. submitApplication
  • 31. Example: client submit an application 1. YarnClient yarnClient = YarnClient.createYarnClient(); 1. YarnClientApplication app = yarnClient.createApplication(); 1. appContext = app.getAppSubmissionContext() …….client logic ….. set command: "$JAVA_HOME/bin/java" + "ApplicationMaster" + command set environments: class path etc. set jars: ………………………….. 1. yarnClient.submitApplication(appContext);
  • 32. Writing ApplicationMaster ● The ApplicationMaster is started. ● In AM code, for each task, to start the container, we repeat a similar procedure as starting the master. o construct ContainerLaunchContext  commands  env  jars
  • 33. Writing ApplicationMaster 1. AM registers with RM (registerApplicationMaster) 1. HeartBeats(allocate) with RM (asynchronously) a. send the Request i. Request new containers. ii. Release containers. b. Received containers and send request to NM to start the container 1. Unregisters with RM (finishApplicationMaster)
  • 34. Writing ApplicationMaster ● RM assigns containers asynchronously ● Containers are likely not returned immediately at current call. ● User needs to give empty requests until it gets the containers it requested. ● ResourceRequest is incremental.
  • 35. ContainerManagementProtocol 1. Start container (task) on NM a. startContainer 1. Monitor the container(task) status a. getContainerStatus 1. Stop the the container (task) a. stopContainer
  • 36. Example - AM: request containers AMRMClient rmClient = AMRMClient.createAMRMClient(); ContainerRequest containerAsk = new ContainerRequest(capability) rmClient.addContainerRequest(containerAsk); Wait until get the containers: do { AllocateResponse response = rmClient.allocate(0); Thread.sleep(100); } while (response.getAllocatedContainers().size() > 0)
  • 37. Example - AM: start/stop containers NMClient nmClient = NMClient.createNMClient(); for (Container container : response.getAllocatedContainers()) { ContainerLaunchContext ctx = ContainerLaunchContext.newInstace(); ctx.setCommands(command); ctx.setEnvironment(envs); nmClient.startContainer(container, ctx); } -monitor container: nmClient.getContainerStatus(containerId) -stop container: nmClient.stopContainer(ContainerId)
  • 38. Takeaway 1. YARN is a resource-management platform that can host different data- processing frameworks (beyond MapReduce). o No longer limited by MR, (batch process, interactive query, stream) o All applications can now co-exist and share the same data on HDFS. 1. YARN is in production now. o Yahoo, Ebay. 1. We welcome your contributions. o patches, tests, writing applications on YARN o https://issues.apache.org/jira/browse/YARN o https://github.com/hortonworks/simple-yarn-app
  • 39. The book is out ! http://yarn-book.com/ http://yarn-book.com/

Editor's Notes

  1. RescourceManager: Arbitrates resources among all the applications in the system NodeManager: the per-machine slave, which is responsible for launching the applications’ containers, monitoring their resource usage ApplicationMaster: Negatiate appropriate resource containers from the Scheduler, tracking their status and monitoring for progress Container: Unit of allocation incorporating resource elements such as memory, cpu, disk, network etc, to execute a specific task of the application (similar to map/reduce slots in MRv1)
  2. A client program submits the application ResourceManager allocates a specified container to start the ApplicationMaster ApplicationMaster, on boot-up, registers with ResourceManager ApplicationMaster negotiates with ResourceManager for appropriate resource containers On successful container allocations, ApplicationMaster contacts NodeManager to launch the container Application code is executed within the container, and then ApplicationMaster is responded with the execution status During execution, the client communicates directly with ApplicationMaster or ResourceManager to get status, progress updates etc. Once the application is complete, ApplicationMaster unregisters with ResourceManager and shuts down, allowing its own