Using Node Labels to Schedule YARN Applications
About this task
Procedure
-
Create a text file and specify the labels you want to use for the nodes in your
cluster. In this example, the file is named
node.labels
. -
Copy the file to a location on MapR filesystem where it will not be modified or deleted, such as
/var/mapr
.hadoop fs -put ~/node.labels /var/mapr
-
Edit
yarn-site.xml
on all ResourceManager nodes and set thenode.labels.file
parameter and the optionalnode.labels.monitor.interval
parameter as shown:<property> <name>node.labels.file</name> <value>/var/mapr/node.labels</value> <description>The path to the node labels file.</description> </property> <property> <name>node.labels.monitor.interval</name> <value>120000</value> <description>Interval for checking the labels file for updates (default is 120000 ms)</description> </property>
-
For this and subsequent changes to take effect, issue either of the following commands to manually tell the ResourceManager to reload the node labels file:
-
For any YARN applications, including MapReduce applications, enter
yarn rmadmin -refreshLabels
-
For MapReduce applications, enter
mapred job -refreshLabels
-
For any YARN applications, including MapReduce applications, enter
-
Verify that labels are implemented correctly by running either of the following
commands:
yarn rmadmin -showLabels mapred job -showlabels