Use partitions (node
labels) when submitting a job
You can use various methods to specify partitions (node labels) when submitting
jobs.
Set Node Labels when Submitting Jobs
If you run this job on the example cluster we configured previously, containers
are allocated on node-1, as this node has been assigned node label "x", and queue
"a1" also has node label "x":
The following commands run the same job that you specified for node label "x", but
this time you will specify queue "b1" rather than queue "a1".
sudo su yarn
hadoop jar /opt/cloudera/parcels/CDH/lib/hadoop-yarn/hadoop-yarn-applications-distributedshell.jar
-shell_command "sleep 100000" -jar /opt/cloudera/parcels/CDH/lib/hadoop-yarn/hadoop-yarn-applications-distributedshell.jar
-num_containers 30 -queue b1 -node_label_expression x
When you attempt to run this job on our example cluster, the job will fail with
the following error message because label "x" is not associated with queue
"b1".
14/11/24 13:42:21 INFO distributedshell.Client: Submitting application to ASM
14/11/24 13:42:21 FATAL distributedshell.Client: Error running Client
org.apache.hadoop.yarn.exceptions.InvalidResourceRequestException: Invalid resource request, queue=b1 doesn't
have permission to access all labels in resource request. labelExpression of resource request=x. Queue labels=y