八天学会hadoop(2) yarn流程

xiaoxiao2025-08-30  9

hdfs 源码分析

FileSystem.get --> 通过反射实例化了一个DistributedFileSystem --> new DFSCilent()把他作为自己的成员变量 在DFSClient构造方法里面,调用了createNamenode,使用了RPC机制,得到了一个NameNode的代理对象,就可以和NameNode进行通信了 FileSystem --> DistributedFileSystem --> DFSClient --> NameNode的代理

简而言之 就是dfs 客户端拿到了namenode代理类

yarn流程

1 客户端想rm 申请job

2 rm 向客户端返回资源路径(hdfs路径) 和jobid  3 客户端把资源(jar包)传入hdfs路径 4 汇报提交资源结果

5rm 将jobs 加入到任务队列 6 nm 领取任务 

7 在各个node manager中启动 container container分配资源(jar包)和内存  8 yarn启动 MrAppMaster 管理mapreduce作业 9MrAppMaster 向rm注册 

 

10 MrAppMaster 在两个container里面启动map任务进程 如果失败了 MrAppMaster再重新启动  

11MrAppMaster 然后启动reduce task 最后所有作业完成 MrAppMaster 向rm 注销自己

 

 

 

转载请注明原文地址: https://www.6miu.com/read-5035453.html

最新回复(0)