hadoop的job分发机制

版权声明:test https://blog.csdn.net/weixin_37275456/article/details/83176057
  1. hadoop的jar包主程序运行到job.waitForCompletion(true);
  2. 向resourcemanger申请一个job任务
  3. resourcemanger返回job相关资源的路径(staging-dir,位于hdfs的temp中,存)和jobid给主程序
  4. 主程序将资源(jar包等)提交到staging-dir,然后向resourcemanger汇报提交成功
  5. resourcemanger将job加到job队列
  6. nodemanger通过心跳机制去检查任务队列,检查是否有需要自己执行的任务,如果有将任务领取
  7. nodemanger领取任务后初始化container,分配资源(内存,磁盘,网络,cpu等),从staging-dir拉取资源。启动nodemanger的MRAppMaster,并向resourceMangeer注册。
  8. nodemanger启动map task,执行map操作
  9. nodemanger启动reduce task,并传递map task的结果
  10. nodemanger的MRAppMaster向resourcemanger注销自己,回收资源
    注意:
    resourcemanger负责资源调度
    MRAppMaster负责监控任务

猜你喜欢

转载自blog.csdn.net/weixin_37275456/article/details/83176057