NM负责启动和管理节点上的containers。AM通过containers来运行任务。

Health Checker Service 创建检查服务

    NM运行一个检查服务来检查节点的状态,该服务可以使用用户自定义的检查脚本。如果节点检查不通过,NM通过heart beat通知RM,RM将不再使用该节点上新增的container。
Disk Checker 磁盘检查
    disk checker会检查NM使用到的磁盘,如local-dirs and log-dirs(本地文件、日志文件)、 configured using yarn.nodemanager.local-dirs and yarn.nodemanager.log-dirs respectively等。检查包括权限、空闲空间、磁盘是否只读等。如果磁盘检查失败,NM不会使用那些有问题的磁盘,但仍将将节点标记为healthy,但是如果相当数量(可以设置值)的磁盘检查失败后,则会将节点标记为unheathy。
    磁盘检查的参数:
Configuration Name Allowed Values Description
yarn.nodemanager.disk-health-checker.enable true, false Enable or disable the disk health checker service
yarn.nodemanager.disk-health-checker.interval-ms Positive integer The interval, in milliseconds, at which the disk checker should run; the default value is 2 minutes
yarn.nodemanager.disk-health-checker.min-healthy-disks Float between 0-1 The minimum fraction of disks that must pass the check for the NodeManager to mark the node as healthy; the default is 0.25
yarn.nodemanager.disk-health-checker.max-disk-utilization-per-disk-percentage Float between 0-100 The maximum percentage of disk space that may be utilized before a disk is marked as unhealthy by the disk checker service. This check is run for every disk used by the NodeManager. The default value is 90 i.e. 90% of the disk can be used.
yarn.nodemanager.disk-health-checker.min-free-space-per-disk-mb Integer The minimum amount of free space that must be available on the disk for the disk checker service to mark the disk as healthy. This check is run for every disk used by the NodeManager. The default value is 0 i.e. the entire disk can be used.

External Health Script 附件健康检查脚本
    用户可以添加额外的健康检查脚本。如果该脚本以非0的状态退出、超时、抛出异常等,则该节点标记为unhealty。注意:如果因为权限问题,该脚本无法被执行,节点也会被标记为unhealthy.附加创建检查脚本不是必须的,如果没胡附加健康检查脚本,则只运行disk checker。
参数:
Configuration Name Allowed Values Description
yarn.nodemanager.health-checker.interval-ms Postive integer The interval, in milliseconds, at which health checker service runs; the default value is 10 minutes.
yarn.nodemanager.health-checker.script.timeout-ms Postive integer The timeout for the health script that’s executed; the default value is 20 minutes.
yarn.nodemanager.health-checker.script.path String Absolute path to the health check script to be run.
yarn.nodemanager.health-checker.script.opts String Arguments to be passed to the script when the script is executed.

NodeManager Restart NM重启

    NM restart保证了在NM重启的过程中,节点上的container能正常运行。NM会把必要的信息存储在节点上的statu-store中,当NM重启后会加载这些信息,然后恢复NM的正常运行。
步骤如下:

Step 1. To enable NM Restart functionality, set the following property in conf/yarn-site.xml to true.  启用NM restart

Property Value
yarn.nodemanager.recovery.enabled true, (default value is set to false)

Step 2. Configure a path to the local file-system directory where the NodeManager can save its run state.  配置state-store

Property Description
yarn.nodemanager.recovery.dir The local filesystem directory in which the node manager will store state when recovery is enabled. The default value is set to$hadoop.tmp.dir/yarn-nm-recovery.

Step 3. Configure a valid RPC address for the NodeManager.  重启后NM可能会使用不同的端口导致client连接失效,因此要把随机端口改成固定端口

Property Description
yarn.nodemanager.address Ephemeral ports (port 0, which is default) cannot be used for the NodeManager’s RPC server specified via yarn.nodemanager.address as it can make NM use different ports before and after a restart. This will break any previously running clients that were communicating with the NM before restart. Explicitly setting yarn.nodemanager.address to an address with specific port number (for e.g 0.0.0.0:45454) is a precondition for enabling NM restart.

Step 4. Auxiliary services.   辅助服务  应用程序应该支持重启

  • NodeManagers in a YARN cluster can be configured to run auxiliary services. For a completely functional NM restart, YARN relies on any auxiliary service configured to also support recovery. This usually includes (1) avoiding usage of ephemeral ports so that previously running clients (in this case, usually containers) are not disrupted after restart and (2) having the auxiliary service itself support recoverability by reloading any previous state when NodeManager restarts and reinitializes the auxiliary service.

  • A simple example for the above is the auxiliary service ‘ShuffleHandler’ for MapReduce (MR). ShuffleHandler respects the above two requirements already, so users/admins don’t have do anything for it to support NM restart: (1) The configuration property mapreduce.shuffle.port controls which port the ShuffleHandler on a NodeManager host binds to, and it defaults to a non-ephemeral port. (2) The ShuffleHandler service also already supports recovery of previous state after NM restarts.  ShuffleHandler支持NM的重启











十二:NodeManager的更多相关文章

  1. CentOS7安装CDH 第十二章:YARN的资源调优

    相关文章链接 CentOS7安装CDH 第一章:CentOS7系统安装 CentOS7安装CDH 第二章:CentOS7各个软件安装和启动 CentOS7安装CDH 第三章:CDH中的问题和解决方法 ...

  2. 前端开发中SEO的十二条总结

    一. 合理使用title, description, keywords二. 合理使用h1 - h6, h1标签的权重很高, 注意使用频率三. 列表代码使用ul, 重要文字使用strong标签四. 图片 ...

  3. CRL快速开发框架系列教程十二(MongoDB支持)

    本系列目录 CRL快速开发框架系列教程一(Code First数据表不需再关心) CRL快速开发框架系列教程二(基于Lambda表达式查询) CRL快速开发框架系列教程三(更新数据) CRL快速开发框 ...

  4. 我的MYSQL学习心得(十二) 触发器

    我的MYSQL学习心得(十二) 触发器 我的MYSQL学习心得(一) 简单语法 我的MYSQL学习心得(二) 数据类型宽度 我的MYSQL学习心得(三) 查看字段长度 我的MYSQL学习心得(四) 数 ...

  5. Web 前端开发精华文章推荐(jQuery、HTML5、CSS3)【系列十二】

    2012年12月12日,[<Web 前端开发人员和设计师必读文章>系列十二]和大家见面了.梦想天空博客关注 前端开发 技术,分享各种增强网站用户体验的 jQuery 插件,展示前沿的 HT ...

  6. 第十二章Fundamental Data Types 基本数据类型

    目录: 12.1 数值概论 12.2整数 12.3浮点数 12.4 字符和字符串 12.5布尔变量 12.6枚举类型 12.7具名常量 12.8数组 12.9创建你自己的类型 12.1   数值概论 ...

  7. [分享] IT天空的二十二条军规

    Una 发表于 2014-9-19 20:25:06 https://www.itsk.com/thread-335975-1-1.html IT天空的二十二条军规 第一条.你不是什么都会,也不是什么 ...

  8. Bootstrap <基础三十二>模态框(Modal)插件

    模态框(Modal)是覆盖在父窗体上的子窗体.通常,目的是显示来自一个单独的源的内容,可以在不离开父窗体的情况下有一些互动.子窗体可提供信息.交互等. 如果您想要单独引用该插件的功能,那么您需要引用  ...

  9. Bootstrap <基础二十二>超大屏幕(Jumbotron)

    Bootstrap 支持的另一个特性,超大屏幕(Jumbotron).顾名思义该组件可以增加标题的大小,并为登陆页面内容添加更多的外边距(margin).使用超大屏幕(Jumbotron)的步骤如下: ...

  10. Bootstrap <基础十二>下拉菜单(Dropdowns)

    Bootstrap 下拉菜单.下拉菜单是可切换的,是以列表格式显示链接的上下文菜单.这可以通过与 下拉菜单(Dropdown) JavaScript 插件 的互动来实现. 如需使用下列菜单,只需要在 ...

随机推荐

  1. Spring 整合Mybatis Mapper动态代理方法

    先看项目目录结构 很清爽了 最重要的Spring的核心配置文件,看一下 <?xml version="1.0" encoding="UTF-8"?> ...

  2. iOS:绘图(18-01-25更)

    目录 1.UIBezierPath(贝塞尔曲线) 1).在重写 drawRect: 方法里使用 2).在普通方法里使用,需要画布. 3). 切圆角.指定位置圆角.任意形状. 4).彩色的动画加载圆圈. ...

  3. svn出现目标计算机积极拒绝无法链接

    这是由于没有启动服务器端监控的原因,只需要执行以下代码即可 svnserve -d --listen-port 8000 -r /opt/svn

  4. css 浮动说明

    clear:both; 1.要了解的:什么是浮动.浮在某面板之上. 例如:float:left; 向左停靠, 就是让需要设置浮动的元素,跟在指定元素后面. 先上实例: 比较常用导航: .nav_ul ...

  5. PHP获取当月天数,获取当月的每天的开始和结束的时间戳,获取当月每号

    由于经常要写导单和数据分析功能,所以要获取什么时间的数据,想什么当天,周,年,月之类的时间格式都很好获取.我今天在这里为大家提供的是当月每天的开始和结束的时间格式. 希望能帮到大家!!! # 获取当月 ...

  6. 【C】关键字void的用法

    void有两种功能 [1]没有 [2]任意类型 void出现的位置不同会有不同的解释 [1]void func( void ) func左边的void,代表『没有返回值』 func右边的括弧里的voi ...

  7. python学习笔记:第12天 列表推导式和生成器

    目录 1. 迭代器 2. 推导式 1. 迭代器 什么是生成器呢,其实生成器的本质就是迭代器:在python中有3中方式来获取生成器(这里主要介绍前面2种) 通过生成器函数获取 通过各种推导式来实现生成 ...

  8. C Mingw gcc printf 刷新缓冲行

    C Mingw gcc printf 刷新缓冲行 参考:https://stackoverflow.com/questions/13035075/printf-not-printing-on-cons ...

  9. AtCoder Regular Contest 100 E - Or Plus Max

    一道很好的dp题 dp[K]存的是 i满足二进制1属于K二进制1位置 最大的两个Ai 这样dp[K]统计的两个数肯定满足(i | j) <= K 然后不断做 update(dp[i | (1&l ...

  10. SQL条件判断中字符串后面有空格的问题

    也不知何时才有的概念,还是以前一直没有注意,从哪也没有听说过的定义,今天又遇见了一个小坑,特记录下来,防止再陷坑! 才疏学浅,文笔有限,简单点说吧,就是在写SQL Server语句时,以前使用了 WH ...