Apache Hadoop YARN
At a glance
- Problem solved: separate cluster resource management from the MapReduce compute model, so that several engines can share the same Hadoop cluster.
- Era: 2013, GA with Hadoop 2.2.0 (October 2013).
- Category: resource management and scheduling.
Historical context
In Hadoop 1, resource management and the MapReduce model are a single block. The YARN paper (SoCC 2013) points out two flaws: this coupling forces developers to "abuse" MapReduce (map-only jobs are used to spawn arbitrary processes), and the centralized handling of jobs raises scheduler scalability concerns. Fixed, typed map/reduce slots also waste resources.
Key idea
Split the functions into separate daemons: a global ResourceManager that arbitrates resources, and one ApplicationMaster per application that drives its own work. MapReduce becomes one application among others on the cluster, next to Spark, Tez, Storm or Giraph.
How it works
- ResourceManager: the single arbitration authority. It contains a Scheduler (pure scheduler, pluggable: CapacityScheduler, FairScheduler) and an ApplicationsManager (accepts submissions, starts and restarts the AM).
- NodeManager: per-machine agent, manages containers and reports their usage (CPU, memory, disk, network).
- ApplicationMaster: framework-specific library, negotiates containers with the Scheduler and tracks its tasks. Restarting failed tasks is its job, not the Scheduler's.
- Container: abstract unit of allocated resources.
- Hadoop 1 MapReduce jobs run on YARN after a simple recompile.
By the numbers
| Figure | Context | Source |
|---|---|---|
| ~5,000 nodes | Production scaling limit of MapReduce, on 2009-vintage hardware (2012) | Hortonworks blog, A. Murthy |
| 500,000 jobs a day | YARN load across all Yahoo! clusters, over 230 compute-years a day on more than 350 PB (2013) | SoCC 2013 paper |
| 77,000 to 100,000 | Jobs on Yahoo!'s busiest 2,500-machine cluster, before and after YARN (2013) | SoCC 2013 paper |
| 125,000 a day | Sustained throughput on that same cluster, peaking at 150,000 (2013) | SoCC 2013 paper |
| 3.2 to 6 cores | Average busy cores per machine (out of 16), Hadoop 1 then YARN (2013) | SoCC 2013 paper |
| 7,000 nodes | Decommissioned machines whose re-provisioning YARN let Yahoo! postpone (2013) | SoCC 2013 paper |
Milestones
- 2 January 2008: Arun Murthy opens ticket MAPREDUCE-279, "Map-Reduce 2.0".
- 11 November 2011: Hadoop 0.23.0 (alpha), first release with "NextGen MapReduce (YARN)".
- 23 May 2012: Hadoop 2.0.0-alpha, first alpha of the 2.x line with YARN.
- August 2012: YARN becomes a subproject of Apache Hadoop, alongside Common, HDFS and MapReduce.
- 1 to 3 October 2013: paper "Apache Hadoop YARN: Yet Another Resource Negotiator" at SoCC.
- 15 October 2013: Hadoop 2.2.0, YARN generally available.
- Late 2017: Hadoop 2.9.0 brings YARN Federation and opportunistic containers.
- 13 December 2017: Hadoop 3.0.0 GA, with administrator-defined resource types (GPUs, licenses...).
Did you know?
- A name picked for its silliness. Arun Murthy recalls that the team was looking over lunch for "the most inane names for our product": "Yet Another Resource Negotiator", which he himself calls a "really bad name" (ADTmag interview, secondary source).
- Definitely not "MapReduce 2.0". Murthy rejects the label: "YARN is not another generation of MapReduce". Yet the original ticket was indeed called "Map-Reduce 2.0".
- The HoD ancestor. Before YARN, Yahoo! shared its machines with Hadoop on Demand, which spun up a dedicated Hadoop cluster per job through the Torque and Maui schedulers.
- A bottleneck moved. At Yahoo!, YARN's log aggregation increased the pressure on the HDFS NameNode, which became the new estimated bottleneck.
Strengths and limitations
| Strengths | Limitations |
|---|---|
| One cluster shared by several engines | Still tied to the Hadoop ecosystem |
| Better resource utilization than slots | Each framework must write its ApplicationMaster |
| Pluggable schedulers (queues, quotas) | Beyond a few thousand nodes, Federation is needed |
What came next
- Spark runs on YARN, among other options.
- Impala plugged into YARN through an intermediary, Llama.
- TODO: source the relationship between YARN and Kubernetes before covering it here.
Sources
raw-data/apache/hadoop/yarn.md- https://hadoop.apache.org/docs/stable/hadoop-yarn/hadoop-yarn-site/YARN.html
- https://hadoop.apache.org/release/2.2.0.html
- Vavilapalli et al., "Apache Hadoop YARN: Yet Another Resource Negotiator", SoCC 2013, https://doi.org/10.1145/2523616.2523633
- https://issues.apache.org/jira/browse/MAPREDUCE-279
- Arun Murthy, "Apache Hadoop YARN: Background and an Overview", Hortonworks, 7 August 2012 (archived copy): https://web.archive.org/web/2013/http://hortonworks.com/blog/apache-hadoop-yarn-background-and-an-overview/
- https://hadoop.apache.org/release/0.23.0.html
- https://hadoop.apache.org/release/2.0.0-alpha.html
- https://hadoop.apache.org/docs/r2.9.0/index.html
- https://hadoop.apache.org/release/3.0.0.html
- https://hadoop.apache.org/docs/r3.0.0/index.html
- [S] https://adtmag.com/blogs/watersworks/2012/08/apache-yarn-promotion.aspx
To do
- Exact date of Hadoop 2.9.0: the documentation was published on 18 November 2017, the release page shows 17 December 2017.
- Place of YARN versus Kubernetes: to be sourced.