Hadoop

YARN Node Labels

2020-02-08  本文已影响0人  spraysss

Overview

Node label 可以用于对Node分组

目前支持的node partition语义如下:

Exclusive vs Non-exclusive

node partitions可以被指定为ExclusiveNon-exclusive:

用户可以指定每个队列可以访问的节点标签集,一个应用程序只能使用包含应用程序的队列可以访问的节点标签集。

Features

Node Labels 支持如下特征:

Configuration

开启节点标签功能

Property Value
yarn.node-labels.fs-store.root-dir hdfs://namenode:port/path/to/store/node-labels/
yarn.node-labels.enabled true
yarn.node-labels.configuration-type 可以指定 “centralized”, “delegated-centralized” 或“distributed”. 默认是 “centralized”.
增加/修改YARN Node Labels
 yarn rmadmin -addToClusterNodeLabels "label_1(exclusive=true/false),label_2(exclusive=true/false)" 

exclusive 默认是true

查看标签
 yarn cluster --list-node-labels
删除YARN Node Labels
yarn rmadmin -removeFromClusterNodeLabels "<label>[,<label>,...]".
增加/修改标签映射
 yarn rmadmin -replaceLabelsOnNode “node1[:port]=label1 node2=label2” [-failOnUnknownNodes]. 
Configuration of Schedulers for node labels

Capacity Scheduler Configuration

Property Value
yarn.scheduler.capacity.<queue-path>.capacity Set the percentage of the queue can access to nodes belong to DEFAULT partition. The sum of DEFAULT capacities for direct children under each parent, must be equal to 100.
yarn.scheduler.capacity.<queue-path>.accessible-node-labels Admin need specify labels can be accessible by each queue, split by comma, like “hbase,storm” means queue can access label hbase and storm. All queues can access to nodes without label, user don’t have to specify that. If user don’t specify this field, it will inherit from its parent. If user want to explicitly specify a queue can only access nodes without labels, just put a space as the value.
yarn.scheduler.capacity.<queue-path>.accessible-node-labels.<label>.capacity Set the percentage of the queue can access to nodes belong to <label> partition . The sum of <label> capacities for direct children under each parent, must be equal to 100. By default, it’s 0.
yarn.scheduler.capacity.<queue-path>.accessible-node-labels.<label>.maximum-capacity Similar to yarn.scheduler.capacity.<queue-path>.maximum-capacity, it is for maximum-capacity for labels of each queue. By default, it’s 100.
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.

example

             root
            /     |    \
     engineer    sales  marketing

我们在集群中有5个节点(主机名=h1..h5),每个节点有24G内存,24个vCore。5个节点中有1个节点有GPU(假设是h5)。所以管理员给h5增加了GPU标签。

假设用户有一个容量调度程序配置,如:(这里使用key=value表示增加可读性)

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

对于h1到h4 ,engineer sales marketing每个可以使用1/3的资源
只有engineering和marketing可以使用GPU机器,每个可以使用1/2的资源

Applications 指定标签Java api

上一篇 下一篇

猜你喜欢

热点阅读