YARN学习总结-第十二节-YARN-Node-Labels

YARN-Node-Labels

目前,我们只支持节点分区:

1.一个节点只能有一个分区,可以通过分区,将节点分为不相交的子集群,目前,默认的分区为partition=""

2.用户需要配置每个分区的资源是如何被不同的队列使用的。

3.有两种节点分区:

Exclusive:只有节点明确匹配分区,才会分配容器。

Non-exclusive:

用户可以指定一些可以被队列访问的标签,应用只能使用分配给队列的标签的子集。

节点标签目前支持以下功能:

Partition cluster:划分集群。

ACL of node-labels on queues:

指定分区的资源百分比,分配给某个队列。

在资源请求时,指定节点标签,容器只会分配到指定标签的节点。

RM重启后,节点标签和节点标签映射可以被重载。

管理员可以在运行时更新节点标签。

配置Node Labels

yarn.node-labels.fs-store.root-dir

yarn.node-labels.enabled

yarn.node-labels.configuartion-type:centralized,delegated-centralized,distributed,默认值为centrialized。

注意:yarn.node-labels.fs-store.root-dir被创建并且RM可以访问,一般为yarn用户

如果是存储标签到本地文件系统,可以指定路径:file:///home/yarn/node-label

yarn rmadmin -addToClusterNodeLabels label1(exclusive=true/false),label2(exclusive=true/false)

yarn cluster --list-node-labels

yarn rmadmin -removeFromClusterNodeLabels <label>

不允许已经关联到队列的标签

yarn cluster --list-node-labels

在Centralized模式下配置节点标签映射:

yarn rmadmin -replaceLabelOnNode node1:port=label1 node2=label2 [-failOnUnknownNodes] 如果不指定端口,则添加标签到NM运行所在节点。

在Distributed模式下配置节点标签映射:

yarn.node-labels.configuration-type

yarn.nodemanager.node-labels.provider:可选的配置有connfig,script,class name。

yarn.nodemanager.node-labels.resync-interval-ms:默认为2min

yarn.nodemanager.node-labels.provider.fetch-interval-ms:

yarn.nodemanager.node-labels.provider.fetch-timeout-ms:

yarn.nodemanager.node-labels.provider.script.path

yarn.nodemanager.node-labels.provider.configured-node-partition

在Delegated-Centralized模式下配置节点标签映射:

yarn.node-labels.configuration-type

yarn.resourcemanager.node-labels.provider

yarn.resourcemanager.node-labels.provider.fetch.interval-ms

配置调度器设置节点标签

yarn.scheduler.capacity.<queue-path>.capacity

yarn.scheduler.capacity.<queue-path>.accessible-node-labels:配置可以访问的标签列表。

yarn.scheduler.capacity.<queue-path>.accessible-node-labels.<label>.capacity

yarn.scheduler.capacity.<queue-path>.accessible-node-labels.<label>.maximum-capacity:默认是100

yarn.scheduler.capacity.<queue-path>.default-node-label-expression

案例:

                root
            /     |    \
     engineer    sales  marketing

We have 5 nodes (hostname=h1..h5) in the cluster, each of them has 24G memory, 24 vcores. 1 among the 5 nodes has GPU (assume it’s h5). So admin added GPU label to h5.

Assume user have a Capacity Scheduler configuration like: (key=value is used here for readability)

yarn.scheduler.capacity.root.queues=engineering,marketing,sales
yarn.scheduler.capacity.root.engineering.capacity=33
yarn.scheduler.capacity.root.marketing.capacity=34
yarn.scheduler.capacity.root.sales.capacity=33

yarn.scheduler.capacity.root.engineering.accessible-node-labels=GPU
yarn.scheduler.capacity.root.marketing.accessible-node-labels=GPU

yarn.scheduler.capacity.root.engineering.accessible-node-labels.GPU.capacity=50
yarn.scheduler.capacity.root.marketing.accessible-node-labels.GPU.capacity=50

yarn.scheduler.capacity.root.engineering.default-node-label-expression=GPU

执行,yarn rmadmin -refreshQueues 应用改变

应用如何指定节点标签

ApplicationSubmissionContext.setNodeLabelExpression(..) 

ResourceRequest.setNodeLabelExpression(..)

setAMContainerResourceRequest.setNodeLabelExpression

监控:

yarn cluster --list-node-labels

yarn node -status <NodeId>

 

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值