You can use various methods to specify partitions when submitting jobs.
Set partitions 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 partition "x", and queue
"a1" also has partition "x":
The following commands run the same job that you specified for partition "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