SlideShare una empresa de Scribd logo
1 de 40
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

Más contenido relacionado

La actualidad más candente

Productionalizing Spark ML
Productionalizing Spark MLProductionalizing Spark ML
Productionalizing Spark MLdatamantra
 
Structured Streaming with Kafka
Structured Streaming with KafkaStructured Streaming with Kafka
Structured Streaming with Kafkadatamantra
 
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 stateYoni Farin
 
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 streamsYoni 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 APIdatamantra
 
Core Services behind Spark Job Execution
Core Services behind Spark Job ExecutionCore Services behind Spark Job Execution
Core Services behind Spark Job Executiondatamantra
 
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 TwillTerence Yim
 
Spark on Kubernetes
Spark on KubernetesSpark on Kubernetes
Spark on Kubernetesdatamantra
 
Introduction to Structured streaming
Introduction to Structured streamingIntroduction to Structured streaming
Introduction to Structured streamingdatamantra
 
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 actorsShashank L
 
Kafka zero to hero
Kafka zero to heroKafka zero to hero
Kafka zero to heroAvi Levi
 
Reactive mistakes reactive nyc
Reactive mistakes   reactive nycReactive mistakes   reactive nyc
Reactive mistakes reactive nycPetr 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 Streamingdatamantra
 
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 RevisedMichael Spector
 
Introduction to Spark Streaming
Introduction to Spark StreamingIntroduction to Spark Streaming
Introduction to Spark StreamingKnoldus 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.0Navina Ramesh
 
Migrating to spark 2.0
Migrating to spark 2.0Migrating to spark 2.0
Migrating to spark 2.0datamantra
 
Apache Spark Internals
Apache Spark InternalsApache Spark Internals
Apache Spark InternalsKnoldus Inc.
 

La actualidad más candente (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
 

Destacado

Introduction to Big Data and Hadoop
Introduction to Big Data and HadoopIntroduction to Big Data and Hadoop
Introduction to Big Data and HadoopEdureka!
 
Apache Hadoop YARN
Apache Hadoop YARNApache Hadoop YARN
Apache Hadoop YARNAdam 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 HadoopHortonworks
 
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 ApplicationsHortonworks
 
Introduction to YARN and MapReduce 2
Introduction to YARN and MapReduce 2Introduction to YARN and MapReduce 2
Introduction to YARN and MapReduce 2Cloudera, Inc.
 

Destacado (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 a 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
 
Introduction to Yarn
Introduction to YarnIntroduction to Yarn
Introduction to YarnOmid Vahdaty
 
Introduction to Yarn
Introduction to YarnIntroduction to Yarn
Introduction to YarnApache Apex
 
Venturing into Hadoop Large Clusters
Venturing into Hadoop Large ClustersVenturing into Hadoop Large Clusters
Venturing into Hadoop Large ClustersVARUN SAXENA
 
Venturing into Large Hadoop Clusters
Venturing into Large Hadoop ClustersVenturing into Large Hadoop Clusters
Venturing into Large Hadoop ClustersNaganarasimha Garla
 
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
 
[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 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 Hadoophitesh1892
 
Venturing into Large Hadoop Clusters
Venturing into Large Hadoop ClustersVenturing into Large Hadoop Clusters
Venturing into Large Hadoop ClustersVARUN 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 FutureVARUN SAXENA
 
Writing YARN Applications Hadoop Summit 2012
Writing YARN Applications Hadoop Summit 2012Writing YARN Applications Hadoop Summit 2012
Writing YARN Applications Hadoop Summit 2012hitesh1892
 
Writing Yarn Applications Hadoop Summit 2012
Writing Yarn Applications Hadoop Summit 2012Writing Yarn Applications Hadoop Summit 2012
Writing Yarn Applications Hadoop Summit 2012Hortonworks
 
Introduction to YARN Apps
Introduction to YARN AppsIntroduction to YARN Apps
Introduction to YARN AppsCloudera, Inc.
 
Session 02 - Yarn Concepts
Session 02 - Yarn ConceptsSession 02 - Yarn Concepts
Session 02 - Yarn ConceptsAnandMHadoop
 
Overview of slider project
Overview of slider projectOverview of slider project
Overview of slider projectSteve Loughran
 

Similar a 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
 

Último

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...apidays
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
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...Drew Madelung
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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 MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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 textsMaria Levchenko
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
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 2024The Digital Insurer
 
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...Neo4j
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
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...Miguel Araújo
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Último (20)

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...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
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
 
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...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

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/

Notas del editor

  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