问题
I am having trouble identifying the differences between the ApplicationMaster and NodeManager in the Hadoop 2.0 architecture.
I know that the ApplicationMaster is responsible for running the map and reduce tasks and it retrieves containers to run these tasks by coordinating with the ResourceManager.
But I am confused on the purpose of the NodeManager. Does the NodeManager create the containers for the ApplicationMaster (to run those map and reduce tasks) or does the ResourceManager create the containers for the ApplicationMaster (to run those map and reduce tasks) and the NodeManager just manages the health of the node, securely place files and directories needed by containers for the ApplicationMaster, and monitor the container's resource usage, etc.
回答1:
ResourceManager(one per cluster) - arbitrates resources among all the applications.
NodeManager - responsible for containers launch, monitoring their resource usage (cpu, memory, disk, network) and reporting it to the ResourceManager/Scheduler.
So, in answer to your question, ResourceManager doesn't launch containers itself it finds the suitable NodeManager that can do that.
Some pictures and links with more details bellow.
YARN Architecture from official Hadoop docs:
Anatomy of a YARN Application Run(from "Hadoop: The Definitive Guide" by Tom White):
来源:https://stackoverflow.com/questions/39552301/hadoop-2-0-applicationmaster-vs-nodemanager