yarn-client模式
1.(NodeManager向ResourceManager汇报资源)在Client提交application,首先在Client启动Driver
2.Client向ResourceManager申请启动ApplicationMaster
3.ResourceManager收到请求后,随机在一台NodeManager节点启动ApplicationMaster
4.ApplicationMaster会向ResourceManager申请资源,用于启动Executor
5.ResourceManager返回给ApplicationMaster返回一批资源(哪些NodeManager可以启动Executor)
6.ApplicationMaster连接NodeManager,启动Executor(内有线程池ThreadPool,用来run task)
7.各个Executor向Driver反向注册
8.Driver就能发送task、监控task执行、回收结果
yarn-cluster模式
1.在client提交application,首先client向RS申请启动ApplicationMaster
2.RS先随机找到一台NodeManager启动ApplicationMaster(身份就是Driver)
3.ApplicationMaster向RS申请启动Executor的资源
4.RS返回一批资源给ApplicationMaster
5.ApplicationMaster连接那些Executor(内置ThreadPool)
6.各个Executor反向注册给ApplicationMaster(充当Drvier)
7.ApplicationMaster发送task、监控task执行,回收结果