Partition a Cluster Using Node Labels
You can use Node labels to partition a cluster into sub-clusters so that jobs run on nodes with specific characteristics.
You can use Node labels to run YARN applications on cluster nodes that have a specified
node label. Node labels can be set as exclusive
or
shareable
:
exclusive
-- Access is restricted to applications running in queues associated with the node label.sharable
-- If idle capacity is available on the labeled node, resources are shared with all applications in the cluster.
The fundamental unit of scheduling in YARN is the queue. The capacity of each queue specifies the percentage of cluster resources that are available for applications submitted to the queue. Queues can be set up in a hierarchy that reflects the resource requirements and access restrictions required by the various organizations, groups, and users that utilize cluster resources.
Node labels enable you partition a cluster into sub-clusters so that jobs can be run on nodes with specific characteristics. For example, you can use node labels to run memory-intensive jobs only on nodes with a larger amount of RAM. Node labels can be assigned to cluster nodes, and specified as exclusive or shareable. You can then associate node labels with capacity scheduler queues. Each node can have only one node label.
Exclusive Node Labels
When a queue is associated with one or more exclusive node labels, all applications submitted by the queue have exclusive access to nodes with those labels.
Shareable Node Labels
When a queue is associated with one or more shareable (non-exclusive) node labels, all applications submitted by the queue get first priority on nodes with those labels. If idle capacity is available on the labeled nodes, resources are shared with other non-labeled applications in the cluster. Non-labeled applications will be preempted if labeled applications request new resources on the labeled nodes.
Queues without Node Labels
If no node label is assigned to a queue, the applications submitted by the queue can run on any node without a node label, and on nodes with shareable node labels if idle resources are available.
Preemption
Labeled applications that request labeled resources preempt non-labeled applications on labeled nodes. If a labeled resource is not explicitly requested, the normal rules of preemption apply. Non-labeled applications cannot preempt labeled applications running on labeled nodes.