YARN中不同类型应用的ApplicationMaster是否存在差异?
Great question! Let me break this down clearly as you're learning YARN's core concepts:
Yes, different types of jobs (like MapReduce, Spark, Flink, etc.) absolutely have their own dedicated ApplicationMasters (AM). This is a key part of YARN's design—separating global resource scheduling from job-specific execution logic.
Let's break it down for the two frameworks you mentioned:
MapReduce Jobs: The MR-specific ApplicationMaster is
org.apache.hadoop.mapreduce.v2.app.MRAppMaster. This AM is built exclusively for MapReduce's workflow: it negotiates resources with YARN's ResourceManager for Map/Reduce tasks, monitors task progress, handles failures and retries, and cleans up resources once the job finishes. It’s fully tailored to MR’s batch-oriented, split-combine computation model.Spark Jobs: When running Spark on YARN (whether in cluster or client mode), Spark uses its own custom ApplicationMaster:
org.apache.spark.deploy.yarn.ApplicationMaster. In cluster mode, this AM even hosts the Spark Driver program directly. It manages requesting YARN containers for Spark Executors, monitors Executor health, coordinates task scheduling across the cluster, and adapts to Spark’s in-memory, iterative computation model—something the MR AM couldn’t handle effectively.
This pattern applies to other distributed frameworks too: Flink, HBase BulkLoad, and even custom YARN applications all come with their own ApplicationMasters. Each AM is designed to understand the unique needs of its framework, letting YARN act as a universal resource layer while letting each system handle its own job execution specifics.
内容的提问来源于stack exchange,提问作者CuriousMind

