关于YARN Node Labels的一点理解
最近在做实验,实验需要进行分区域计算,网上查了资料后发现Yarn Node Labels + Capacity-Scheduler可以实现我的需求
但是当任务提交到capacity-scheduler调度器的default队列时,任务卡在ACCEPTED阶段。
网上看了很多发现没有这方面的信息,最后在Apache hadoop官网的官方手册上查到有以下信息
| property | Value |
| yarn.scheduler.capacity.<queue-path>.default-node-label-expression | Value like “hbase”, which means: if applications submitted to the queue without specifying node label in their resource requests, it will use “hbase” as default-node-label-expression. By default, this is empty, so application will get containers from nodes without label. |
从官网上说明来看,如果yarn.scheduler.capacity.<queue-path>.default-node-label-expression设置了value,那么提交到queue中的任务如果没有说明用什么label,则使用这个value所定义的label;如果这个value为空,那么提交到这个队列的任务只能在不含有label的node上执行。此处的value只能是一个label,不能是多个label。
也就是说yarn node label中的queue只能默认使用一个label,不能多label使用,如果某个queue没有指定label,那么该queue中job只能在没有label的node上执行。
我的实验环境中所有的nodemanager都设置了yarn node labels,yarn.scheduler.capacity.root.default.default-node-label-expression=' ',所以当我任务提交到capacity-scheduler调度器的default队列时,任务卡在ACCEPTED阶段,因为没有不绑定label的节点,所以任务卡在了accepted了。
下面说下我的实验环境及需求
我的需求:

我的capacity-scheduler.xml文件中配置:yarn.scheduler.capacity.root.default.default-node-label-expression=' '
上图中default queue队列不能在Host1,Host2,Host3上运行,因为Host1,Host2,Host3都有Node-label。
根据以上需求,我配置文件如下:
在yarn-site.xml中开启capacity-schedule
<property>
<name>yarn.resourcemanager.scheduler.class</name>
<value>org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler</value>
</property>
配置capacity-scheduler.xml文件
<configuration>
<property>
<name>yarn.scheduler.capacity.root.queues</name>
<value>default,area0,area1,area2</value>
<description>
The queues at the this level (root is the root queue).
</description>
</property> <property>
<name>yarn.scheduler.capacity.root.default.capacity</name>
<value>25</value>
</property> <property>
<name>yarn.scheduler.capacity.root.area0.capacity</name>
<value>25</value>
</property> <property>
<name>yarn.scheduler.capacity.root.area1.capacity</name>
<value>25</value>
</property> <property>
<name>yarn.scheduler.capacity.root.area2.capacity</name>
<value>25</value>
</property> <property>
<name>yarn.scheduler.capacity.root.default.maximum-capacity</name>
<value>100</value>
</property> <property>
<name>yarn.scheduler.capacity.root.area0.maximum-capacity</name>
<value>100</value>
</property> <property>
<name>yarn.scheduler.capacity.root.area1.maximum-capacity</name>
<value>100</value>
</property> <property>
<name>yarn.scheduler.capacity.root.area2.maximum-capacity</name>
<value>100</value>
</property> <property>
<name>yarn.scheduler.capacity.root.accessible-node-labels</name>
<value>*</value>
</property> <property>
<name>yarn.scheduler.capacity.root.area0.accessible-node-labels</name>
<value>area0</value>
</property> <property>
<name>yarn.scheduler.capacity.root.area1.accessible-node-labels</name>
<value>area1</value>
</property> <property>
<name>yarn.scheduler.capacity.root.area2.accessible-node-labels</name>
<value>area2</value>
</property> <property>
<name>yarn.scheduler.capacity.root.accessible-node-labels.area0.capacity</name>
<value>33</value>
</property> <property>
<name>yarn.scheduler.capacity.root.accessible-node-labels.area1.capacity</name>
<value>33</value>
</property> <property>
<name>yarn.scheduler.capacity.root.accessible-node-labels.area2.capacity</name>
<value>34</value>
</property> <property>
<name>yarn.scheduler.capacity.root.area0.accessible-node-labels.area0.capacity</name>
<value>100</value>
</property> <property>
<name>yarn.scheduler.capacity.root.area1.accessible-node-labels.area1.capacity</name>
<value>100</value>
</property> <property>
<name>yarn.scheduler.capacity.root.area2.accessible-node-labels.area2.capacity</name>
<value>100</value>
</property> <property>
<name>yarn.scheduler.capacity.root.default-node-label-expression</name>
<value> ,area0,area1,area2</value>
</property>
<!--value为空,则root.default队列只能在没有label的node上执行,而我环境环境中不存在没有label的node,所以提交到root.default的任务卡死-->
<property>
<name>yarn.scheduler.capacity.root.default.default-node-label-expression</name>
<value> </value>
</property> <property>
<name>yarn.scheduler.capacity.root.area0.default-node-label-expression</name>
<value>area0</value>
</property> <property>
<name>yarn.scheduler.capacity.root.area1.default-node-label-expression</name>
<value>area1</value>
</property> <property>
<name>yarn.scheduler.capacity.root.area2.default-node-label-expression</name>
<value>area2</value>
</property>
</configuration>
添加Yarn Node Labels
#添加标签
yarn rmadmin -addToClusterNodeLabels area0,area1,area2
#节点添加标签
yarn rmadmin -replaceLabelsOnNode Host1:,area0
yarn rmadmin -replaceLabelsOnNode Host2:,area1
yarn rmadmin -replaceLabelsOnNode Host3:,area2
#查看标签
yarn node -status Host1:45454
#也可以通过Yarn管理页面查看Node Label
配置Yarn Node Labels存储目录,这样不用每次重启服务后重新配置Yarn Node Labels。
在yarn-site.xml中添加下列信息
<property>
<name>yarn.node-labels.enabled</name>
<value>true</value>
</property>
<property>
<name>yarn.nodemanager.address</name>
<value>0.0.0.0:</value>
</property> <property>
<name>yarn.node-labels.manager-class</name>
<value>org.apache.hadoop.yarn.server.resourcemanager.nodelabels.RMNodeLabelsManager</value>
</property>
<property>
<name>yarn.node-labels.fs-store.root-dir</name>
<value>hdfs://Host0:8020/yarn/node-labels</value>
<description>标签数据在HDFS上的存储位置</description>
</property>
在HDFS上创建相应的目录,并修改权限,我权限设置成了777
这样配置好之后,yarn node labels就不用重复配置了
关于YARN Node Labels的一点理解的更多相关文章
- Yarn Node Labels
Yarn Node Labels + Capacity-Scheduler 在yarn-site.xml中开启capacity-schedule yarn-site.xml <property& ...
- <Yarn><Node Labels>
Go through official docs For the official docs of Yarn node label, plase see here. Overview Node lab ...
- 六:YARN Node Labels
参考:http://dongxicheng.org/mapreduce-nextgen/hadoop-yarn-label-based-scheduling/ 为不同的DATANODE打标签,通过标签 ...
- rt-thread中软件定时器组件超时界限的一点理解
@2019-01-15 [小记] 对 rt-thread 中的软件定时器组件中超时界限的一点理解 rt_thread_timer_entry(void *parameter)函数中if ((next_ ...
- opencv笔记5:频域和空域的一点理解
time:2015年10月06日 星期二 12时14分51秒 # opencv笔记5:频域和空域的一点理解 空间域和频率域 傅立叶变换是f(t)乘以正弦项的展开,正弦项的频率由u(其实是miu)的值决 ...
- 对socket的一点理解笔记
需要学web service,但是在视频中讲解到了socket套接字编程.以前貌似课上老师有提过,只是没用到也感觉乏味.现在遇到,自己看了些博客和资料.记录一点理解,不知正确与否. 首先说这个名字,叫 ...
- iOS 的一点理解(一) 代理delegate
做了一年的iOS,想记录自己对知识点的一点理解. 第一篇,想记录一下iOS中delegate(委托,也有人称作代理)的理解吧. 故名思议,delegate就是代理的含义, 一件事情自己不方便做,然后交 ...
- 关于web开发的一点理解
对于web开发上的一点理解 1 宏观上的一点理解 网页从请求第地址 到获得页面的过程:从客户端(浏览器)通过地址 从soket把请求报文封装发往服务端 服务端通过解析报文并处理报文最后把处理的结果 ...
- angular.js的一点理解
对angular.js的一点理解 2015-01-14 13:18 by MrGeorgeZhao, 317 阅读, 4 评论, 收藏, 编辑 最近一直在学习angular.js.不得不说和jquer ...
随机推荐
- python去掉字符串中空格的方法
1.strip():把头和尾的空格去掉 2.lstrip():把左边的空格去掉 3.rstrip():把右边的空格去掉 4.replace('c1','c2'):把字符串里的c1替换成c2.故可以用r ...
- 【代码笔记】iOS-JQIndicatorViewDemo
一,效果图. 二,工程图. 三,代码. #import "ViewController.h" #import "JQIndicatorView.h" @inte ...
- <Android 基础(三十二)> ViewFlipper
简介 View Flipper,是ViewAnimator的子类,而ViewAnimator又是继承自FrameLayout,而FrameLayout就是平时基本上只显示一个子视图的布局,由于Fram ...
- JMeter4.0的界面汉化
1.安装好之后 2.界面汉化 options->choose language->chinese(simplified) 3.汉化完成
- python学习笔记之——python面向对象
Python是一门面向对象语言. 1.面向对象技术介绍 类(Class): 用来描述具有相同的属性和方法的对象的集合.它定义了该集合中每个对象所共有的属性和方法.对象是类的实例. 类变量:类变量在整个 ...
- SQLServer 学习笔记之超详细基础SQL语句 Part 11
Sqlserver 学习笔记 by:授客 QQ:1033553122 -----------------------接Part 10------------------- DECLARE @myavg ...
- 安卓测试【三】adb简单命令及monkey使用
Ⅰ 配置好android sdk环境变量之后,将android手机连接到电脑上,进行一些adb的简单命令的操作. adb,安卓调试桥,android sdk的一个工具.直接操作管理安卓模拟器或者真 ...
- CSS 小结笔记之em
1.为什么使用em em也是css中的一种单位,和px类似.很多人会疑惑为什么有了px之后还要使用em,而且em使用起来相对于px来讲比较麻烦. em主要是应用于弹性布局,下面给出一个小栗子说明em的 ...
- Spring hibernate 事务的流程
1 在业务方法开始之前 ①获取session ②把session和当前线程绑定,这样就可以在Dao中使用SessionFactory的getCurrentSession()方法来获取session了 ...
- Javaweb学习(二):Http通信协议
当我们开始jsp/servlet编程之旅之前,我们还需要知道一些关于网络通讯方面的一些知识.这样能更加有助于我们的理解,希望大家能看懂我的描述,而不至于在学习的路上一知半解.(手动比❤) 认识Ht ...