(2)YARN的工作流程
Writing YARN Applications
文档中的启动过程:
Application submission client向Yarn ResourceManager提交一个Application,RM、NM、AM处理流程。
首先,创建一个YarnClient对象并start它,然后Client可以设置ApplicationContext。为app准备第一个container来contain ApplicationMaster,然后提交Application。
RM在已经指定的Container中启动ApplicationMaster。AM与YARN集群通信,处理Application的执行。在app启动的过程中(app的启动过程中,AM与RM的通信是异步的),AM的主要工作包括:
(1)与RM通信,协商为之后的Containers分配资源(通过AMRMClientAsync对象,AMRMClientAsync.CallbackHandler指定事件的处理方法);
(2)Container分配之后,与NodeManagers通信,启动它们所在节点的app的Containers(启动一个Runnable对象,当为Containers分配资源之后,启动containers。作为启动Container的一部分,AM需要指定带有启动信息的ContainerLaunchContext)。
在Application执行的过程中,ApplicationMaster通过NMClientAsync对象与NodeManagers通信。所有Containers的事件由NMClientAsync.CallbackHandler处理。
一个callback handler处理Client的start,stop,status update以及error。
(1) 创建一个YarnClient对象并start它,然后Client可以设置ApplicationContext,然后向ResourceManager提交Application。
(2)RM向NM发出指令,为该App启动第一个Container,并在其中启动ApplicationMaster
(3)AM向RM注册
(4)AM采用轮询的方式向RM的YARN Scheduler申请资源
(5)当AM申请到资源后(即获取到了空闲节点的信息),与NodeManagers通信(多个NodeManager),请求启动计算任务
(6)NodeManagers根据资源量的大小、所需的运行环境,在Container中启动任务。
(7)各个任务向AM汇报自己的状态和进度,以便AM掌握各个任务的执行情况
(8)APP运行完成后,AM向RM注销并关闭自己。
原文:
The general concept is that an application submission client submits an application to the YARN ResourceManager (RM). This can be done through setting up a YarnClient object. After YarnClient is started, the client can then set up application context, prepare the very first container of the application that contains the ApplicationMaster (AM), and then submit the application. You need to provide information such as the details about the local files/jars that need to be available for your application to run, the actual command that needs to be executed (with the necessary command line arguments), any OS environment settings (optional), etc. Effectively, you need to describe the Unix process(es) that needs to be launched for your ApplicationMaster.
The YARN ResourceManager will then launch the ApplicationMaster (as specified) on an allocated container. The ApplicationMaster communicates with YARN cluster, and handles application execution. It performs operations in an asynchronous fashion. During application launch time, the main tasks of the ApplicationMaster are: a) communicating with the ResourceManager to negotiate and allocate resources for future containers, and b) after container allocation, communicating YARN *NodeManager*s (NMs) to launch application containers on them. Task a) can be performed asynchronously through an AMRMClientAsync object, with event handling methods specified in a AMRMClientAsync.CallbackHandler type of event handler. The event handler needs to be set to the client explicitly. Task b) can be performed by launching a runnable object that then launches containers when there are containers allocated. As part of launching this container, the AM has to specify the ContainerLaunchContext that has the launch information such as command line specification, environment, etc.
参考:
(1)《Hadoop The Definitive Guide 4th》
(2)http://hadoop.apache.org/docs/r2.7.2/hadoop-yarn/hadoop-yarn-site/WritingYarnApplications.html
(2)YARN的工作流程的更多相关文章
- Yarn的工作流程
http://study.163.com/course/courseLearn.htm?courseId=1002887002#/learn/video?lessonId=1003346099& ...
- Hadoop YARN 的工作流程简述
1.Client 向 YARN 提交应用程序,其中包括 ApplicationMaster 程序及启动 ApplicationMaster 命令2.ResourceManager 为该 Applica ...
- yarn工作流程
YARN 是 Hadoop 2.0 中的资源管理系统, 它的基本设计思想是将 MRv1 中的 JobTracker拆分成了两个独立的服务 : 一个全局的资源管理器 ResourceManager 和每 ...
- Yarn框架和工作流程研究
一.概述 将公司集群升级到Yarn已经有一段时间,自己也对Yarn也研究了一段时间,现在开始记录一下自己在研究Yarn过程中的一些笔记.这篇blog主要主要从大体上说说Yarn的基本架构以及其 ...
- Spark基本工作流程及YARN cluster模式原理(读书笔记)
Spark基本工作流程及YARN cluster模式原理 转载请注明出处:http://www.cnblogs.com/BYRans/ Spark基本工作流程 相关术语解释 Spark应用程序相关的几 ...
- yarn的基本组成和工作流程
yarn是负责资源管理的,协调各个应用程序的资源使用情况 一.基本组成 yarn主要由以下几个部分组成 1.resourcemanager 主要负责资源的调度和应用程序的管理 (1)调度器 调度器是将 ...
- MapReduce与Yarn 的详细工作流程分析
MapReduce详细工作流程之Map阶段 如上图所示 首先有一个200M的待处理文件 切片:在客户端提交之前,根据参数配置,进行任务规划,将文件按128M每块进行切片 提交:提交可以提交到本地工作环 ...
- MR1和MR2(Yarn)工作原理流程
一.Mapreduce1 图1 MR1工作原理图 工作流程主要分为以下6个步骤: 1 作业的提交 1)客户端向jobtracker请求一个新的作业ID(通过JobTracker的getNewJobI ...
- Hadoop yarn工作流程详解
yarn是什么?1.它是一个资源调度及提供作业运行的系统环境平台 资源:cpu.mem等 作业:map task.reduce Task yarn产生背景?它是从hadoop2.x版本才引入1.had ...
随机推荐
- XAF-如何实现自定义权限系统用户对象
本示例使用XPO. 新建一个XAF项目.填加两个类进来: [DefaultClassOptions] public class Employee : Person { public Employe ...
- Git积累
1.使用git config命令进行配置(此配置为全局配置,这些是在提交commit时的签名): $ git config --global user.name "填写github的用户名& ...
- 【 C# 】(一) ------------- 泛型带头节点的单链表,双向链表实现
在编程领域,数据结构与算法向来都是提升编程能力的重点.而一般常见的数据结构是链表,栈,队列,树等.事实上C#也已经封装好了这些数据结构,在头文件 System.Collections.Generic ...
- 用Unity的UGUI实现简单摇杆
1.在Canvas下新建一个空对象作为我们的摇杆,命名为Joystick. 摇杆由背景和杆两部分组成,所以在Joystick下新建一个Image作为摇杆的背景,命名为BG. 在BG下新建一个Image ...
- 有序链表转换二叉搜索树(LeetCode)
将一个按照升序排列的有序数组,转换为一棵高度平衡二叉搜索树. 本题中,一个高度平衡二叉树是指一个二叉树每个节点 的左右两个子树的高度差的绝对值不超过 1. 示例: 给定有序数组: [-10,-3,0, ...
- 1.VBA 基本概念——《Excel VBA 程序开发自学宝典》
1.1 常见对象及含义 对象名 含义 application 整个Excel应用程序 window 窗口 worksheet 一个工作表 sheets 指定工作簿的所有工作表的合集 shaperan ...
- 帝国cms后台集成ueditor编辑器
我更换成百度编辑器的原因有以下几点:1.使用百度编辑器的图片粘贴上传功能,这个功能实在是太有必要了,有开发的过程中或上传的过程中,通常用qq直接截图,直接放到文章上面,避免了再放到本地保存的情况,真是 ...
- Redis源码阅读(一)事件机制
Redis源码阅读(一)事件机制 Redis作为一款NoSQL非关系内存数据库,具有很高的读写性能,且原生支持的数据类型丰富,被广泛的作为缓存.分布式数据库.消息队列等应用.此外Redis还有许多高可 ...
- CocoStuff—基于Deeplab训练数据的标定工具【一、翻译】(未完)
一.CocoStuff简介 CocoStuff是一款为deeplab设计的,运行在Matlab中的语义标定工具,其标定结果和结合Deeplab训练出的结果均为mat文件格式,该项目源码已在github ...
- MFC -- Excel操作简介(基于VS2010)
一.添加与 Excel 操作相关的头文件 项目 -> 类向导,在右上方有一个下拉栏,选择其中的 类型库中的MFC类(T),即可看到下图所示界面,选择“文件”选项,然后在下方的位置选项中添加本地文 ...