From fecbac499e2ae6b3334773a997d454a518f43e01 Mon Sep 17 00:00:00 2001 From: Robert Kanter Date: Fri, 27 Jul 2018 14:32:34 -0700 Subject: [PATCH] YARN-8566. Add diagnostic message for unschedulable containers (snemeth via rkanter) --- .../src/site/markdown/ResourceManagerRest.md | 285 ++++++++++++++++++ 1 file changed, 285 insertions(+) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/ResourceManagerRest.md b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/ResourceManagerRest.md index a30677c042..24c2319895 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/ResourceManagerRest.md +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/ResourceManagerRest.md @@ -2326,6 +2326,291 @@ Response Body: ``` +Containers for an Application Attempt API +----------------------------------------- + +With Containers for an Application Attempt API you can obtain the list of containers, which belongs to an Application Attempt. + +### URI + + * http://rm-http-address:port/ws/v1/cluster/apps/{appid}/appattempts/{appAttemptId}/containers + +### HTTP Operations Supported + + * GET + +### Query Parameters Supported + + None + +### Elements of the *containers* object + +When you make a request for the list of containers, the information will be returned as an array of container objects. + +containers: + +| Item | Data Type | Description | +|:---- |:---- |:---- | +| containers | array of app container objects(JSON)/zero or more container objects(XML) | The collection of app container objects | + +### Elements of the *container* object + +| Item | Data Type | Description | +|:---- |:---- |:---- | +| containerId | string | The container id | +| allocatedMB | long | The amount of memory allocated for the container in MB | +| allocatedVCores | int | The amount of virtual cores allocated for the container | +| assignedNodeId | string | The node id of the node the attempt ran on | +| priority | int | Allocated priority of the container | +| startedTime | long | The start time of the attempt (in ms since epoch) | +| finishedTime | long | The finish time of the attempt (in ms since epoch) 0 if not finished | +| elapsedTime | long | The elapsed time in ms since the startedTime | +| logUrl | string | The web URL that can be used to check the log for the container | +| containerExitStatus | int | Final exit status of the container | +| containerState | string | State of the container, can be NEW, RUNNING, or COMPLETE | +| nodeHttpAddress | string | The node http address of the node the attempt ran on || +| nodeId | string | The node id of the node the attempt ran on | +| allocatedResources |array of resource(JSON)/zero or more resource objects(XML) | Allocated resources for the container | + +### Elements of the *resource* object +| Item | Data Type | Description | +|:---- |:---- |:---- | +| memory | int | The maximum memory for the container | +| vCores | int | The maximum number of vcores for the container | + +**JSON response** + +HTTP Request: + + GET http://rm-http-address:port/ws/v1/cluster/apps/{appid}/appattempts/{appAttemptId}/containers + +Response Header: + + HTTP/1.1 200 OK + Content-Type: application/json + Transfer-Encoding: chunked + Server: Jetty(6.1.26) + +Response Body: + +```json +{ + "containers" : { + "container": [ + { + "containerId": "container_1531404209605_0008_01_000001", + "allocatedMB": "1536", + "allocatedVCores": "1", + "assignedNodeId": "host.domain.com:37814", + "priority": "0", + "startedTime": "1531405909444", + "finishedTime": "0", + "elapsedTime": "4112", + "logUrl": "http://host.domain.com:8042/node/containerlogs/container_1531404209605_0008_01_000001/systest", + "containerExitStatus": "0", + "containerState": "RUNNING", + "nodeHttpAddress": "http://host.domain.com:8042", + "nodeId": "host.domain.com:37814", + "allocatedResources": [ + { + "key": "memory-mb", + "value": "1536" + }, + { + "key": "vcores", + "value": "1" + } + ] + } + ] + } +} +``` + +**XML response** + +HTTP Request: + + GET http://rm-http-address:port/ws/v1/cluster/apps/{appid}/appattempts/{appAttemptId}/containers + Accept: application/xml + +Response Header: + + HTTP/1.1 200 OK + Content-Type: application/xml + Content-Length: 1104 + Server: Jetty(6.1.26) + +Response Body: + +```xml + + + + container_1531404209605_0008_01_000001 + 1536 + 1 + host.domain.com:37814 + 0 + 1531405909444 + 0 + 4112 + + http://host.domain.com:8042/node/containerlogs/container_1531404209605_0008_01_000001/systest + + 0 + RUNNING + http://host.domain.com:8042 + host.domain.com:37814 + + + memory-mb + 1536 + + + vcores + 1 + + + + +``` + +Specific Container for an Application Attempt API +------------------------------------------------- + +With Specific Container for an Application Attempt API you can obtain information about a specific container, which belongs to an Application Attempt and selected by the container id. + +### URI + + * http://rm-http-address:port/ws/v1/cluster/apps/{appid}/appattempts/{appAttemptId}/containers/{containerId} + +### HTTP Operations Supported + + * GET + +### Query Parameters Supported + + None + +### Elements of the *container* object + +| Item | Data Type | Description | +|:---- |:---- |:---- | +| containerId | string | The container id | +| allocatedMB | long | The amount of memory allocated for the container in MB | +| allocatedVCores | int | The amount of virtual cores allocated for the container | +| assignedNodeId | string | The node id of the node the attempt ran on | +| priority | int | Allocated priority of the container | +| startedTime | long | The start time of the attempt (in ms since epoch) | +| finishedTime | long | The finish time of the attempt (in ms since epoch) 0 if not finished | +| elapsedTime | long | The elapsed time in ms since the startedTime | +| logUrl | string | The web URL that can be used to check the log for the container | +| containerExitStatus | int | Final exit status of the container | +| containerState | string | State of the container, can be NEW, RUNNING, or COMPLETE | +| nodeHttpAddress | string | The node http address of the node the attempt ran on || +| nodeId | string | The node id of the node the attempt ran on | +| allocatedResources |array of resource(JSON)/zero or more resource objects(XML) | Allocated resources for the container | + +### Elements of the *resource* object +| Item | Data Type | Description | +|:---- |:---- |:---- | +| memory | int | The maximum memory for the container | +| vCores | int | The maximum number of vcores for the container | + +**JSON response** + +HTTP Request: + + GET http://rm-http-address:port/ws/v1/cluster/apps/{appid}/appattempts/{appAttemptId}/containers/{containerId} + +Response Header: + + HTTP/1.1 200 OK + Content-Type: application/json + Transfer-Encoding: chunked + Server: Jetty(6.1.26) + +Response Body: + +```json +{ + "container": { + "containerId": "container_1531404209605_0008_01_000001", + "allocatedMB": "1536", + "allocatedVCores": "1", + "assignedNodeId": "host.domain.com:37814", + "priority": "0", + "startedTime": "1531405909444", + "finishedTime": "0", + "elapsedTime": "4112", + "logUrl": "http://host.domain.com:8042/node/containerlogs/container_1531404209605_0008_01_000001/systest", + "containerExitStatus": "0", + "containerState": "RUNNING", + "nodeHttpAddress": "http://host.domain.com:8042", + "nodeId": "host.domain.com:37814", + "allocatedResources": [ + { + "key": "memory-mb", + "value": "1536" + }, + { + "key": "vcores", + "value": "1" + } + ] + } +} +``` + +**XML response** + +HTTP Request: + + GET http://rm-http-address:port/ws/v1/cluster/apps/{appid}/appattempts/{appAttemptId}/containers/{containerId} + Accept: application/xml + +Response Header: + + HTTP/1.1 200 OK + Content-Type: application/xml + Content-Length: 1104 + Server: Jetty(6.1.26) + +Response Body: + +```xml + + + + container_1531404209605_0008_01_000001 + 1536 + 1 + host.domain.com:37814 + 0 + 1531405909444 + 0 + 4112 + + http://host.domain.com:8042/node/containerlogs/container_1531404209605_0008_01_000001/systest + + 0 + RUNNING + http://host.domain.com:8042 + host.domain.com:37814 + + + memory-mb + 1536 + + + vcores + 1 + + + +``` + Cluster Nodes API -----------------