基于YARN的两种提交模式

yarn-cluster提交模式:

1,spark-submit提交,发送请求到ResourceManager请求启动ApplicationMaster;

2,ResourceManager分配container在某个nodemanager上,启动ApplicationMaster(相当于Driver);

3,ApplicationMaster找到ResourceManager,进行反注册,请求container启动executor;

4,ResourceManager分配一批container用于启动executor;

5,ApplicationMaster连接其他NodeManager来启动executor,这里的NodeManager相当于Worker,executor启动后向ApplicationMaster反注册。

yarn-client提交模式:

1,spark-submit提交,在本地启动Driver进程,并发送请求给ResourceManager,请求ApplicationMaster。

2,ResourceManager接收到请求之后分配一个container在某个NodeManager(其实只是一个ExecutorLauncher,相当于ApplicationMaster)。

3,ExecutorLanucher向ResourceManager申请container,启动executor;

4,ResourceManager分配一批contianer然后ApplicationMaster直接连接启动NodeManager,用contianer的资源,启动executor;

5,executor启动后会反注册到本地的Driver上。

猜你喜欢

转载自blog.csdn.net/smart_cxr/article/details/81151540