Using Node Labels to Schedule YARN Applications
About this task
Procedure
-
Enable the labels by using the following steps:
- Add the
yarn.node-labels.enabled
parameter to theyarn-site.xml
file:<property> <name>yarn.node-labels.enabled</name> <value>true</value> </property>
- Restart the ResourceManager
(RM):
/opt/mapr/bin/maprcli node services -name resourcemanager -nodes <node names> -action restart
- Add the
-
Add labels to clusters and nodes:
yarn rmadmin -addToClusterNodeLabels "label3, label4" yarn rmadmin -replaceLabelsOnNode "node3.cluster.com:8099=label3 node4.cluster.com:8099=label4"
-
To gather information about the labels, use any of the following commands:
- To list the node labels:
yarn cluster --list-node-labels Node Labels: <label4:exclusivity=true>,<label3:exclusivity=true>
- To reload the queues, states, and scheduler-specific
properties:
yarn rmadmin -refreshQueues
- To show the node
status:
yarn node -status node3.cluster.com:8099 Node Report : Node-Id : node3.cluster.com:8099 Rack : /default-rack Node-State : RUNNING Node-Http-Address : node3.cluster.com:8044 Last-Health-Update : Tue 24/Jan/23 03:16:07:88UTC Health-Report : Containers : 0 Memory-Used : 0MB Memory-Capacity : 45744MB CPU-Used : 0 vcores CPU-Capacity : 40 vcores Node-Labels : label3 Node Attributes : Resource Utilization by Node : PMem:21544 MB, VMem:21544 MB, VCores:2.6766665 Resource Utilization by Containers : PMem:0 MB, VMem:0 MB, VCores:0.0
- To list the node labels: