diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/NodeLabel.md b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/NodeLabel.md new file mode 100644 index 0000000..a1a0a80 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/NodeLabel.md @@ -0,0 +1,118 @@ + + +Yarn Node Labels +=============== + +# Overview +Node label is a way to group nodes with similar characteristics and application can specify where to run. + +Now we only support node partition, which is: + +* One node can have only one node partition, so a cluster is partitioned to several disjoint sub-clusters by node partitions. +* You need configure how many resources of each partition can be used by different queues, see next sections. +* There’re two kinds of node partitions + * Exclusive: Containers will be allocated to nodes with exactly match node partition. (e.g. asking partition=“x” will be allocated to node with partition=“x”, asking partition=“” will be allocated to node without specifying partition). + * Non-exclusive: The only difference between exclusive and non-exclusive is, when you ask partition=“”, which means you don’t care about where to run. You can be allocated to node without specifying partition or node with non-exclusive partition which has idle resource. + +You can specify set of node labels can be accessed by each queues, one application can only use subset of node labels can be accessed by the queue which contains the application. You can specify which node partition is need when allocating container or submiting application. + +# Features +The ```Node Labels``` supports the following features for now: + +* Partition cluster - each node can be assigned one label, so the cluster will be divided to several smaller disjoint partitions. +* ACL of node-labels on queues - you can set accessible node labels on each queue so only some nodes can only be accessed by specific queues. +* Percentage of each queue can access resource with each label - you can set percentage like: queue-A can access 30% of resources on nodes with label=hbase. Such percentage setting will be consistent with existing resource manager +* Specify node label requirement in Resource request, it will only be allocated when node has the same label. If no node label requirement specified, such Resource Request will only be allocated on nodes without any label +* Operability + * Node labels and node labels mapping can be recovered across RM restart + * Update node labels - user/admin can update labels on nodes and labels on queues + when RM is running + +# Configuration +## Setting up ```ResourceManager``` to enable ```Node Labels```: + +Property | Value +--- | ---- +yarn.node-labels.fs-store.root-dir | hdfs://namenode:port/path/to/store/node-labels/ +yarn.node-labels.enabled | true + +Notes: +* Make sure ```yarn.node-labels.fs-store.root-dir``` is created and ```ResourceManager``` has permission to access it. (Typically from “yarn” user) + +### Add node labels list and node-to-labels mapping to YARN +* Add cluster node labels list: + * Executing ```yarn rmadmin -addToClusterNodeLabels label_1(exclusive=true/false),label_2(exclusive=true/false)``` to add node label. + * If you don’t specify “(exclusive=…)”, execlusive will be ```true``` by default. + * Run ```yarn cluster --list-node-labels``` to check you have added node labels to the cluster. +* Add labels to nodes + * Executing ```yarn rmadmin -replaceLabelsOnNode “node1[:port]=label1 node2=label2”```. Added label1 to node1, label2 to node2. If you don’t specify port, it added the label to all ```NodeManagers``` running on the node. + +## Configuration of Schedulers for node labels +### Capacity Scheduler Configuration +Property | Value +----- | ------ +yarn.scheduler.capacity.``.capacity | Queue capacity in percentage (%) as a float (e.g. 12.5). The sum of capacities for all queues, at each level, must be equal to 100. When there’re labels on some nodes in the cluster, this means percentage of resources on nodes without label. +yarn.scheduler.capacity.``.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, you don’t have to specify that. If you don’t specify this field, it will inherit from its parent. If you want to explicitly specify a queue can only access nodes without labels, just put a space as the value. +yarn.scheduler.capacity.``.accessible-node-labels.`