YARN label 特性 & 指定队列及label提交任务
以下基于 hadoop版本 hadoop-2.8.4
给各个节点打标签
yarn rmadmin -addToClusterNodeLabels fastcpu,normal
# 是否独占默认是true,不独占其他队列就可以normal标签资源
yarn rmadmin -addToClusterNodeLabels "fastcpu,normal(exclusive=false)"
yarn rmadmin -replaceLabelsOnNode "container-192-168-200-140,fastcpu"
# container-192-168-200-141不打标签,也可以不执行此命令
yarn rmadmin -replaceLabelsOnNode "container-192-168-200-141, "
yarn rmadmin -replaceLabelsOnNode "container-192-168-200-142,normal"
1.spark任务可以通过spark-submit方式指定参数spark.yarn.am.nodeLabelExpression和spark.yarn.executor.nodeLabelExpression来实现,使任务提交到特定的分区。
./bin/spark-submit --class org.apache.spark.examples.SparkPi
--master yarn --deploy-mode cluster --driver-memory 3g --executor-memory 2g
--conf spark.yarn.am.nodeLabelExpression=fastcpu
--conf spark.yarn.executor.nodeLabelExpression=fastcpu jars/spark-examples.jar 10
2.hadoop distribute shell / hadoop job 也可以。
hadoop jar ./share/hadoop/yarn/hadoop-yarn-applications-distributedshell-2.8.4.jar -shell_command "sleep 100000" -jar ./share/hadoop/yarn/hadoop-yarn-applications-distributedshell-2.8.4.jar -num_containers 5 -queue etl-ywpt -node_label_expression fastcpu
mr example wordcount:
hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.8.4.jar wordcount -D mapreduce.job.node-label-expression="fastcpu" -D mapreduce.job.queuename="etl-ywpt" /hadoop-hadoop-namenode-container-192-168-200-140.log /output
3.另外还可以通过yarn代码的方式提交;hive可以指定如下参数 提交指定队列及label。
set mapreduce.job.node-label-expression=fastcpu;
set mapreduce.job.queuename=etl-bi;
yarn web ui
yarn 8088调度页面

node 的 label 页面

容量调度才能使用label便签,公平调度暂时不支持标签。
配置文件 capacity-scheduler.xml
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->
<configuration>
<property>
<name>yarn.scheduler.capacity.maximum-applications</name>
<value>10000</value>
<description>
Maximum number of applications that can be pending and running.
</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.queues</name>
<value>default,etl-ywpt,etl-bi,etl-ly,etl-test,hue,bi</value>
</property>
<!--
<property>
<name>yarn.scheduler.capacity.root.acl_submit_applications</name>
<value> </value>
</property>
<property>
<name>yarn.scheduler.capacity.root.acl_administer_queue</name>
<value>hadoop </value>
</property>
-->
<property>
<name>yarn.scheduler.capacity.maximum-am-resource-percent</name>
<value>0.2</value>
<description>
Maximum percent of resources in the cluster which can be used to run
application masters i.e. controls number of concurrent running
applications.
</description>
</property>
<property>
<name>yarn.scheduler.capacity.resource-calculator</name>
<value>org.apache.hadoop.yarn.util.resource.DominantResourceCalculator</value>
</property>
<!--
<property>
<name>yarn.scheduler.capacity.resource-calculator</name>
<value>org.apache.hadoop.yarn.util.resource.DefaultResourceCalculator</value>
<description>
The ResourceCalculator implementation to be used to compare
Resources in the scheduler.
The default i.e. DefaultResourceCalculator only uses Memory while
DominantResourceCalculator uses dominant-resource to compare
multi-dimensional resources such as Memory, CPU etc.
</description>
</property>
-->
<!-- label两种模式 normal/fastcpu -->
<!-- root队列可提交的标签 -->
<property>
<name>yarn.scheduler.capacity.root.capacity</name>
<value>100</value>
</property>
<property>
<name>yarn.scheduler.capacity.root.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.accessible-node-labels.normal.capacity</name>
<value>100</value>
<description>root队列对normal标签节点可用的百分比</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.accessible-node-labels.fastcpu.capacity</name>
<value>100</value>
<description>root队列对fastcpu标签节点可用的百分比</description>
</property>
<!-- default队列 -->
<property>
<name>yarn.scheduler.capacity.root.default.accessible-node-labels</name>
<value>normal</value>
<description>default队列应用可用的节点标签</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.default.default-node-label-expression</name>
<value>normal</value>
<description>default队列应用默认节点标签</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.default.accessible-node-labels.normal.capacity</name>
<value>10</value>
<description>default队列对normal标签节点可用的百分比</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.default.accessible-node-labels.normal.maximum-capacity</name>
<value>50</value>
</property>
<property>
<name>yarn.scheduler.capacity.root.default.capacity</name>
<value>10</value>
<description>Default queue target capacity.</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.default.maximum-capacity</name>
<value>20</value>
<description>
The maximum capacity of the default queue.
</description>
</property>
<!-- etl-ywpt队列 -->
<property>
<name>yarn.scheduler.capacity.root.etl-ywpt.accessible-node-labels</name>
<value>*</value>
<description>etl-ywpt队列应用可用的节点标签</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.etl-ywpt.default-node-label-expression</name>
<value>normal</value>
<description>etl-ywpt队列应用默认节点标签</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.etl-ywpt.accessible-node-labels.normal.capacity</name>
<value>10</value>
<description>etl-ywpt队列对fastcpu标签节点可用的百分比</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.etl-ywpt.accessible-node-labels.normal.maximum-capacity</name>
<value>20</value>
</property>
<property>
<name>yarn.scheduler.capacity.root.etl-ywpt.accessible-node-labels.fastcpu.capacity</name>
<value>50</value>
<description>etl-ywpt队列对fastcpu标签节点可用的百分比</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.etl-ywpt.accessible-node-labels.fastcpu.maximum-capacity</name>
<value>60</value>
</property>
<property>
<name>yarn.scheduler.capacity.root.etl-ywpt.capacity</name>
<value>5</value>
</property>
<property>
<name>yarn.scheduler.capacity.root.etl-ywpt.maximum-capacity</name>
<value>30</value>
</property>
<!-- etl-bi队列 -->
<property>
<name>yarn.scheduler.capacity.root.etl-bi.accessible-node-labels</name>
<value>fastcpu</value>
<description>etl-bi队列应用可用的节点标签</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.etl-bi.default-node-label-expression</name>
<value>fastcpu</value>
<description>etl-bi队列应用默认节点标签</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.etl-bi.accessible-node-labels.fastcpu.capacity</name>
<value>50</value>
<description>etl-bi队列对fastcpu标签节点可用的百分比</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.etl-bi.accessible-node-labels.fastcpu.maximum-capacity</name>
<value>100</value>
</property>
<property>
<name>yarn.scheduler.capacity.root.etl-bi.capacity</name>
<value>3</value>
</property>
<property>
<name>yarn.scheduler.capacity.root.etl-bi.maximum-capacity</name>
<value>20</value>
</property>
<!-- etl-ly队列 -->
<property>
<name>yarn.scheduler.capacity.root.etl-ly.accessible-node-labels</name>
<value>normal</value>
<description>etl-ly队列应用可用的节点标签</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.etl-ly.default-node-label-expression</name>
<value>normal</value>
<description>etl-ly队列应用默认节点标签</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.etl-ly.accessible-node-labels.normal.capacity</name>
<value>20</value>
<description>default队列对normal标签节点可用的百分比</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.etl-ly.accessible-node-labels.fastcpu.maximum-capacity</name>
<value>100</value>
</property>
<property>
<name>yarn.scheduler.capacity.root.etl-ly.capacity</name>
<value>52</value>
</property>
<property>
<name>yarn.scheduler.capacity.root.etl-ly.maximum-capacity</name>
<value>55</value>
</property>
<!-- etl-test队列 -->
<property>
<name>yarn.scheduler.capacity.root.etl-test.accessible-node-labels</name>
<value>normal</value>
<description>etl-test队列应用可用的节点标签</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.etl-test.default-node-label-expression</name>
<value>normal</value>
<description>etl-test队列应用默认节点标签</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.etl-test.accessible-node-labels.normal.capacity</name>
<value>10</value>
<description>etl-test队列对normal标签节点可用的百分比</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.etl-test.accessible-node-labels.normal.maximum-capacity</name>
<value>100</value>
</property>
<property>
<name>yarn.scheduler.capacity.root.etl-test.capacity</name>
<value>10</value>
</property>
<property>
<name>yarn.scheduler.capacity.root.etl-test.maximum-capacity</name>
<value>50</value>
</property>
<!-- hue队列 -->
<property>
<name>yarn.scheduler.capacity.root.hue.accessible-node-labels</name>
<value>normal</value>
<description>hue队列应用可用的节点标签</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.hue.default-node-label-expression</name>
<value>normal</value>
<description>hue队列应用默认节点标签</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.hue.accessible-node-labels.normal.capacity</name>
<value>10</value>
<description>hue队列对normal标签节点可用的百分比</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.hue.accessible-node-labels.normal.maximum-capacity</name>
<value>100</value>
</property>
<property>
<name>yarn.scheduler.capacity.root.hue.capacity</name>
<value>10</value>
</property>
<property>
<name>yarn.scheduler.capacity.root.hue.maximum-capacity</name>
<value>50</value>
</property>
<!-- bi队列 -->
<property>
<name>yarn.scheduler.capacity.root.bi.accessible-node-labels</name>
<value>normal</value>
<description>bi队列应用可用的节点标签</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.bi.default-node-label-expression</name>
<value>normal</value>
<description>bi队列应用默认节点标签</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.bi.accessible-node-labels.normal.capacity</name>
<value>40</value>
<description>bi队列对fastcpu标签节点可用的百分比</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.bi.accessible-node-labels.normal.maximum-capacity</name>
<value>100</value>
</property>
<property>
<name>yarn.scheduler.capacity.root.bi.capacity</name>
<value>10</value>
</property>
<property>
<name>yarn.scheduler.capacity.root.bi.maximum-capacity</name>
<value>20</value>
</property>
</configuration>
YARN label 特性 & 指定队列及label提交任务的更多相关文章
- django-celery 创建多个broker队列 异步执行任务时指定队列
一.这里不再详细述说 django 框架中如何使用celery, 重点放在如何实现创建多个队列, 并指定队列存放异步任务 笔者使用 django-celery==3.2.2 模块, 配置项及配置参 ...
- 洛谷 P1160 队列安排 Label:链表 数据结构
题目描述 一个学校里老师要将班上N个同学排成一列,同学被编号为1-N,他采取如下的方法: 1.先将1号同学安排进队列,这时队列中只有他一个人: 2.2-N号同学依次入列,编号为i的同学入列方式为:老师 ...
- 转: 【Java并发编程】之二十一:并发新特性—阻塞队列和阻塞栈(含代码)
转载请注明出处:http://blog.csdn.net/ns_code/article/details/17511147 阻塞队列 阻塞队列是Java5并发新特性中的内容,阻塞队列的接口是Java. ...
- db2 v9.7 新特性cur_commit 能够实现未提交读新特性cur_commit 能够实现未提交读
db2 get db cfg|find "CUR_COMMIT" 当前已落实 (CUR_COMMIT) = ON ...
- 【Java并发编程】:并发新特性—塞队列和阻塞栈
阻塞队列 阻塞队列是Java5并发新特性中的内容,阻塞队列的接口是Java.util.concurrent.BlockingQueue,它有多个实现类:ArrayBlockingQueue.Delay ...
- 使用FROM确认按钮(键盘13号键)提交特性并使用ajax.POST提交.
如果又想使用FROM确认按钮(键盘13号键)提交特性 还能继续用AJAX.POST提交.就需要使用return false 来阻止FROM默认提交 代码如下: HTML页面 这里最关键就是用了ret ...
- label 标签的用法,点label选中单选、复选框或文本框
<label>拥有的权限</label> <label class="checkbox" id="privilege_id" st ...
- Java高级特性—消息队列
1)什么是jms JMS即Java消息服务(Java Message Service)应用程序接口是一个Java平台中关于面向消息中间件(MOM)的API. 它便于消息系统中的Java应用程序进行消息 ...
- Qt添加窗口背景图片、Label图片显示、、Label文字显示
一.添加窗口背景图片 重写MainWindow绘制事件 void MainWindow::paintEvent(QPaintEvent *event) { QPainter painter(this) ...
随机推荐
- Ntfs 下的链接符号创建
熟悉过 Unix/Linux 都应该知道,Unix/Linux 用 ln 建立硬链接,ln -s 建立软链接(符号链接). 硬链接和符号链接的区别 Ntfs下的也有链接符: 内置命令:mklink ...
- PCM简介
1. 差分脉冲编码调制 如果两个相邻抽样值之间的相关性很大,那么它们的差值就较小,这样,仅对差值量化可以使用较少的比特数,此即差分PCM,或DPCM. 为了理论方便,我们将采样和量化分开,并用不带上三 ...
- [蓝桥杯]ALGO-86.算法训练_矩阵乘法
问题描述 输入两个矩阵,分别是m*s,s*n大小.输出两个矩阵相乘的结果. 输入格式 第一行,空格隔开的三个正整数m,s,n(均不超过200). 接下来m行,每行s个空格隔开的整数,表示矩阵A(i,j ...
- [转].NET Framework、C#、CLR和Visual Studo之间的版本关系
原文地址:http://www.xcode.me/more/microsoft-net-framework-version-define C#版本 .NET Framework版本 CLR版本 Vis ...
- Java-Runoob-高级教程-实例-方法:06. Java 实例 – 方法覆盖
ylbtech-Java-Runoob-高级教程-实例-方法:06. Java 实例 – 方法覆盖 1.返回顶部 1. Java 实例 - 方法覆盖 Java 实例 前面章节中我们已经学习了 Jav ...
- [转][html5]网页横屏
@@media screen and (orientation:portrait){ body{ transform: rotate(90deg); } } 将以上 CSS 加入网页,可以发现手机上查 ...
- 【转】十年你能做的能得到的有多少?一个工科IT男的工作回忆
https://blog.csdn.net/b5w2p0/article/details/8798989
- 廖雪峰Java1-2程序基础-9数组
数组初识 1.数组的特点: 数组所有元素初始化默认值,int默认值为0 数组创建后大小不可改变 数组索引从0开始 数组是引用类型 使用索引下标访问数组元素,索引超出范围会报错 2.数组的定义: 类型[ ...
- 第9章 应用层(4)_超文本传输协议HTTP
5. 超文本传输协议HTTP 5.1 统一资源定位符URL (1)URL的一般形式:<协议>://<主机>:<端口>/<路径> ①协议后面必须写上“:/ ...
- WebUploader 手机端上传图片(转)
https://blog.csdn.net/loserorleader/article/details/50395040