Communications among Yarn's daemons
Communication between Clients and ResourceManager:
Clients initiate the process by submitting application requests (jobs) to the ResourceManager.
They communicate with the ResourceManager to get an application ID, negotiate initial resources for the ApplicationMaster, and later query the status and progress of their submitted applications.
Communications between ResourceManager and NodeManager:
The ResourceManager and NodeManagers maintain a continuous dialogue.
NodeManagers periodically send heartbeats to the ResourceManager, signaling their health, available resources, and the status of containers running on their node.
The ResourceManager sends instructions to NodeManagers, such as commands to launch or kill containers for specific applications.
Communications between ResourceManager and ApplicationMaster:
When an application is submitted, the ResourceManager allocates the initial container to launch the ApplicationMaster.
The ApplicationMaster then negotiates resources (more containers) from the ResourceManager for its application's tasks, communicating its resource needs and receiving allocations.
The ApplicationMaster also reports its application's overall progress and status back to the ResourceManager.
Communications between NodeManager and Containers:
The NodeManager is directly responsible for managing the lifecycle of containers on its local node.
It launches containers as instructed by the ApplicationMaster (via ResourceManager's allocation and subsequent instructions), monitors their resource usage (CPU, memory), and manages their execution environment.
The NodeManager also terminates containers when their tasks are complete or if they exceed their allocated resources.
Communications between ApplicationMaster and Containers:
While the NodeManager launches containers, the ApplicationMaster indirectly manages its application's containers by instructing the NodeManager.
Once launched, the application code running inside a container communicates its progress, status, and any errors back to its controlling ApplicationMaster via an application-specific protocol. The ApplicationMaster uses this information to track the job's overall execution and to request new containers if tasks fail.