1. Overview
The following describes how NodeManager starts and registers various services.
Mainly involved Java files
Package org. apache. hadoop. yarn. server. resourcemanager under hadoop-yarn-server-resourcemanager:
ResourcesManager. java
2. Code Analysis
When Hadoop is started. The main of ResourcesManager is executed.
1). main Function
- Perform initialization, such as reading configuration information, and then create ResourcesManager
- Run the init () function of ResourcesManager.
- Execute the start () function of ResourcesManager.
2). init Function
- Set configuration parameters
- Create objects such as AsyncDispatcher, ContainerAllocationExpirer, ResourceTrackerService, ApplicationMasterService, ApplicationMasterLauncher, kerberoscheduler (which can be changed by default), and ClientRMService, and set these objects (or services) added to the ArrayList <Service> Object serviceList (different from NodeManager). This process is similar to the init () Execution Process in NodeManager.
- Register all SchedulerEventDispatcher, RMAppManager, ApplicationEventDispatcher, and their corresponding EventsType to AsyncDispatcher.
3). start () function
- Reads configuration information and performs security operation authentication.
- Call the start () function of the parent class to start all services in serviceList.
Some started services are provided.