Skip to content

Commit 0d2d6f9

Browse files
committed
YARN-9792. Document examples of SchedulerConf with Node Labels. Contributed by Prabhu Joseph
1 parent 2e1fd44 commit 0d2d6f9

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/ResourceManagerRest.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5292,6 +5292,87 @@ Response Header:
52925292
Content-Type: application/xml
52935293
Transfer-Encoding: chunked
52945294

5295+
**Adding Node Labels to a queue**
5296+
5297+
Assuming we are using the capacity scheduler and the current queue configuration is two queues root.default, and root.a, this example adds a Node Label x to the queue root.a. Create a Node Label x and assign the nodes with below commands.
5298+
5299+
```yarn rmadmin -addToClusterNodeLabels "x(exclusive=true)"```
5300+
5301+
```yarn rmadmin -replaceLabelsOnNode "<nodeId>=x"```
5302+
5303+
HTTP Request:
5304+
5305+
```xml
5306+
Accept: application/xml
5307+
PUT http://rm-http-address:port/ws/v1/cluster/scheduler-conf
5308+
Content-Type: application/xml
5309+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
5310+
<sched-conf>
5311+
<update-queue>
5312+
<queue-name>root.a</queue-name>
5313+
<params>
5314+
<entry>
5315+
<key>accessible-node-labels</key>
5316+
<value>x</value>
5317+
</entry>
5318+
<entry>
5319+
<key>accessible-node-labels.x.capacity</key>
5320+
<value>100</value>
5321+
</entry>
5322+
</params>
5323+
</update-queue>
5324+
<update-queue>
5325+
<queue-name>root</queue-name>
5326+
<params>
5327+
<entry>
5328+
<key>accessible-node-labels.x.capacity</key>
5329+
<value>100</value>
5330+
</entry>
5331+
</params>
5332+
</update-queue>
5333+
</sched-conf>
5334+
```
5335+
5336+
5337+
Response Header:
5338+
5339+
HTTP/1.1 200 OK
5340+
Content-Type: application/xml
5341+
Transfer-Encoding: chunked
5342+
5343+
**Removing Node Labels from a queue**
5344+
5345+
Assuming we are using the capacity scheduler and the current queue configuration is two queues root.default, and root.a and Node Label x is assigned to queue root.a. This example unsets the Node Label x from the queue root.a and removes it.
5346+
5347+
HTTP Request:
5348+
5349+
```xml
5350+
Accept: application/xml
5351+
PUT http://rm-http-address:port/ws/v1/cluster/scheduler-conf
5352+
Content-Type: application/xml
5353+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
5354+
<sched-conf>
5355+
<update-queue>
5356+
<queue-name>root.a</queue-name>
5357+
<params>
5358+
<entry>
5359+
<key>accessible-node-labels</key>
5360+
<value></value>
5361+
</entry>
5362+
</params>
5363+
</update-queue>
5364+
</sched-conf>
5365+
```
5366+
5367+
5368+
Response Header:
5369+
5370+
HTTP/1.1 200 OK
5371+
Content-Type: application/xml
5372+
Transfer-Encoding: chunked
5373+
5374+
```yarn rmadmin -removeFromClusterNodeLabels x```
5375+
52955376

52965377
Cluster Container Signal API
52975378
--------------------------------

0 commit comments

Comments
 (0)