简介
ResourceManager REST API允许用户获取关于集群的信息——集群上的状态、集群上的指标、调度程序信息、集群中节点的信息以及集群上应用程序的信息。
启用 CORS 支持
只对RM(不支持NM)启用跨原点支持(CORS),请设置以下配置参数:
在core-site.xml内添加 org.apache.hadoop.security.HttpCrossOriginFilterInitializer 到hadoop.http.filter.initializers。在yarn-site.xml内设置yarn.resourcemanager.webapp.cross-origin.enabled 为true
获取集群信息的 API
集群信息资源提供关于集群的总体信息。
- URI
下面两个都可以获取集群信息
* http://<rm http address:port>/ws/v1/cluster
* http://<rm http address:port>/ws/v1/cluster/info
- HTTP操作支持
get
- 查询参数支持
none
- clusterInfo对象的元素
名称 | 类型 | 描述 |
---|---|---|
id | long | 群集ID |
startedOn | long | 群集开始的时间(从epoch开始以ms为单位) |
state | string | ResourceManager状态-有效值为: NOTINITED, INITED, STARTED, STOPPED |
haState | string | ResourceManager HA状态-有效值为:INITIALIZING, ACTIVE, STANDBY, STOPPED |
rmStateStoreName | string | 实现ResourceManager状态存储的类的完全限定名 |
resourceManagerVersion | string | ResourceManager的版本号 |
resourceManagerBuildVersion | string | 带有生成版本、用户和校验和的ResourceManager生成字符串 |
resourceManagerVersionBuiltOn | string | 生成ResourceManager时的时间戳(从epoch起以ms为单位) |
hadoopVersion | string | Hadoop Common版本 |
hadoopBuildVersion | string | 具有生成版本、用户和校验和的Hadoop公共生成字符串 |
hadoopVersionBuiltOn | string | |
haZooKeeperConnectionState | string | 高可用的zk连接状态 |
- 请求实例
在这里就以JSON response为例
HTTP Request:
GET http://<rm http address:port>/ws/v1/cluster/info
Response Header:
HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
Response Body:
{
"clusterInfo":
{
"id":1324053971963,
"startedOn":1324053971963,
"state":"STARTED",
"haState":"ACTIVE",
"rmStateStoreName":"org.apache.hadoop.yarn.server.resourcemanager.recovery.NullRMStateStore",
"resourceManagerVersion":"3.0.0-SNAPSHOT",
"resourceManagerBuildVersion":"3.0.0-SNAPSHOT from unknown by user1 source checksum 11111111111111111111111111111111",
"resourceManagerVersionBuiltOn":"2016-01-01T01:00Z",
"hadoopVersion":"3.0.0-SNAPSHOT",
"hadoopBuildVersion":"3.0.0-SNAPSHOT from unknown by user1 source checksum 11111111111111111111111111111111",
"hadoopVersionBuiltOn":"2016-01-01T01:00Z",
"haZooKeeperConnectionState": "ResourceManager HA is not enabled." }
}
获取集群指标的 API
集群度量资源提供关于集群的一些总体度量。应该从jmx接口检索更详细的指标。
- URI
http://<rm http address:port>/ws/v1/cluster/metrics
- HTTP操作支持
get
- 查询参数支持
none
- clusterMetrics对象的元素
名称 | 类型 | 描述 |
---|---|---|
appsSubmitted | int | 提交的 applications 数量 |
appsCompleted | int | 已完成的 applications 数量 |
appsPending | int | 等待中的 applications 数量 |
appsRunning | int | 运行中的 applications 数量 |
appsFailed | int | 失败的 applications 数量 |
appsKilled | int | 已kill掉的 applications 数量 |
reservedMB | long | 以MB为单位保留的内存量 |
availableMB | long | 可用内存量(MB) |
allocatedMB | long | 已经分配的内存量(MB) |
totalMB | long | 总内存量(MB) |
reservedVirtualCores | long | 保留的虚拟核数 |
availableVirtualCores | long | 可用虚拟核的数量 |
allocatedVirtualCores | long | 已分配的虚拟核数 |
totalVirtualCores | long | 虚拟核的总数 |
containersAllocated | int | 已经分配的容器数 |
containersReserved | int | 保留的容器数 |
containersPending | int | 挂起的容器数 |
totalNodes | int | 节点总数 |
activeNodes | int | 活动节点数 |
lostNodes | int | 丢失的节点数 |
unhealthyNodes | int | 不正常节点的数目 |
decommissioningNodes | int | 正在解除授权的节点数 |
decommissionedNodes | int | 已解除授权的节点数 |
rebootedNodes | int | 重新启动的节点数 |
shutdownNodes | int | 关闭的节点数 |
- 请求实例
在这里就以JSON response为例
HTTP Request:
GET http://<rm http address:port>/ws/v1/cluster/metrics
Response Header:
HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
Response Body:
{
"clusterMetrics":
{
"appsSubmitted":0,
"appsCompleted":0,
"appsPending":0,
"appsRunning":0,
"appsFailed":0,
"appsKilled":0,
"reservedMB":0,
"availableMB":17408,
"allocatedMB":0,
"reservedVirtualCores":0,
"availableVirtualCores":7,
"allocatedVirtualCores":1,
"containersAllocated":0,
"containersReserved":0,
"containersPending":0,
"totalMB":17408,
"totalVirtualCores":8,
"totalNodes":1,
"lostNodes":0,
"unhealthyNodes":0,
"decommissioningNodes":0,
"decommissionedNodes":0,
"rebootedNodes":0,
"activeNodes":1,
"shutdownNodes":0
}
}
获取集群调度的 API
包含集群调度的当前配置信息。它目前支持Fifo、容量和公平调度程序。根据配置的调度程序,您将获得不同的信息,因此请确保查看类型信息
- URI
http://<rm http address:port>/ws/v1/cluster/scheduler
- HTTP操作支持
get
- 查询参数支持
none
- Capacity Scheduler API
容量调度程序支持分层队列。这一个请求将打印有关所有队列及其所有子队列的信息。实际上可以向其提交作业的队列称为叶队列。这些队列具有与之关联的其他数据。
- schedulerInfo对象的元素
名称 | 类型 | 描述 |
---|---|---|
type | string | 调度的类型 - capacityScheduler |
capacity | float | 配置的队列容量(相对于其父队列的百分比) |
usedCapacity | float | 已用队列容量百分比 |
maxCapacity | float | 配置的最大队列容量(相对于其父队列的百分比) |
queueName | string | 队列的名字 |
queues | array of queues(JSON)/zero or more queue objects(XML) | 队列资源的集合 |
- the queues object for a Parent queue的元素
名称 | 类型 | 描述 |
---|---|---|
capacity | float | 配置的队列容量(相对于其父队列的百分比) |
usedCapacity | float | 已用队列容量百分比 |
maxCapacity | float | 配置的最大队列容量(相对于其父队列的百分比) |
absoluteCapacity | float | 此队列可以使用整个群集的绝对容量百分比 |
absoluteMaxCapacity | float | 此队列可以使用整个群集的绝对最大容量百分比 |
absoluteUsedCapacity | float | 此队列使用的整个群集的绝对已用容量百分比 |
numApplications | int | 队列中当前的应用程序数 |
usedResources | string | 描述队列使用的当前资源的字符串 |
queueName | string | 队列的名字 |
state | string of QueueState | 队列的状态 |
queues | array of queues(JSON)/zero or more queue objects(XML) | 子队列信息的集合。如果队列没有子队列,则省略。 |
resourcesUsed | A single resource object | 此队列使用的资源总量 |
- Elements of the queues object for a Leaf queue - contains all the elements in parent except ‘queues’ plus the following
名称 | 类型 | 描述 |
---|---|---|
type | String | 队列类型 - capacitySchedulerLeafQueueInfo |
numActiveApplications | int | 此队列中的活着的应用程序数量 |
numPendingApplications | int | 此队列中的挂起的应用程序数量 |
numContainers | int | 正在使用的容器数 |
maxApplications | int | 此队列可以拥有的最大应用程序数 |
maxApplicationsPerUser | int | 此队列每个用户可以拥有的最大应用程序数 |
maxActiveApplications | int | 此队列可以拥有的最大活动应用程序数 |
maxActiveApplicationsPerUser | int | 此队列可以拥有的每个用户的最大活动应用程序数 |
userLimit | int | 配置中设置的最小用户限制百分比 |
userLimitFactor | float | 配置中设置的用户限制因子 |
users | array of users(JSON)/zero or more user objects(XML) | 包含所用资源的用户对象集合 |
- Elements of the user object for users
名称 | 类型 | 描述 |
---|---|---|
username | String | 使用资源的用户的用户名 |
resourcesUsed | A single resource object | 此队列中用户使用的资源量 |
numActiveApplications | int | 此队列中此用户的活动应用程序数 |
numPendingApplications | int | 此队列中此用户的挂起应用程序数 |
- Elements of the user object for users
名称 | 类型 | 描述 |
---|---|---|
memory | int | The amount of memory used (in MB) |
vCores | int | 虚拟核的数量 |
- 请求实例
在这里就以JSON response为例
HTTP Request:
GET http://<rm http address:port>/ws/v1/cluster/scheduler
Response Header:
HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
Response Body:
{
"scheduler": {
"schedulerInfo": {
"capacity": 100.0,
"maxCapacity": 100.0,
"queueName": "root",
"queues": {
"queue": [
{
"absoluteCapacity": 10.5,
"absoluteMaxCapacity": 50.0,
"absoluteUsedCapacity": 0.0,
"capacity": 10.5,
"maxCapacity": 50.0,
"numApplications": 0,
"queueName": "a",
"queues": {
"queue": [
{
"absoluteCapacity": 3.15,
"absoluteMaxCapacity": 25.0,
"absoluteUsedCapacity": 0.0,
"capacity": 30.000002,
"maxCapacity": 50.0,
"numApplications": 0,
"queueName": "a1",
"queues": {
"queue": [
{
"absoluteCapacity": 2.6775,
"absoluteMaxCapacity": 25.0,
"absoluteUsedCapacity": 0.0,
"capacity": 85.0,
"maxActiveApplications": 1,
"maxActiveApplicationsPerUser": 1,
"maxApplications": 267,
"maxApplicationsPerUser": 267,
"maxCapacity": 100.0,
"numActiveApplications": 0,
"numApplications": 0,
"numContainers": 0,
"numPendingApplications": 0,
"queueName": "a1a",
"resourcesUsed": {
"memory": 0,
"vCores": 0
},
"state": "RUNNING",
"type": "capacitySchedulerLeafQueueInfo",
"usedCapacity": 0.0,
"usedResources": "<memory:0, vCores:0>",
"userLimit": 100,
"userLimitFactor": 1.0,
"users": null
},
{
"absoluteCapacity": 0.47250003,
"absoluteMaxCapacity": 25.0,
"absoluteUsedCapacity": 0.0,
"capacity": 15.000001,
"maxActiveApplications": 1,
"maxActiveApplicationsPerUser": 1,
"maxApplications": 47,
"maxApplicationsPerUser": 47,
"maxCapacity": 100.0,
"numActiveApplications": 0,
"numApplications": 0,
"numContainers": 0,
"numPendingApplications": 0,
"queueName": "a1b",
"resourcesUsed": {
"memory": 0,
"vCores": 0
},
"state": "RUNNING",
"type": "capacitySchedulerLeafQueueInfo",
"usedCapacity": 0.0,
"usedResources": "<memory:0, vCores:0>",
"userLimit": 100,
"userLimitFactor": 1.0,
"users": null
}
]
},
"resourcesUsed": {
"memory": 0,
"vCores": 0
},
"state": "RUNNING",
"usedCapacity": 0.0,
"usedResources": "<memory:0, vCores:0>"
},
{
"absoluteCapacity": 7.35,
"absoluteMaxCapacity": 50.0,
"absoluteUsedCapacity": 0.0,
"capacity": 70.0,
"maxActiveApplications": 1,
"maxActiveApplicationsPerUser": 100,
"maxApplications": 735,
"maxApplicationsPerUser": 73500,
"maxCapacity": 100.0,
"numActiveApplications": 0,
"numApplications": 0,
"numContainers": 0,
"numPendingApplications": 0,
"queueName": "a2",
"resourcesUsed": {
"memory": 0,
"vCores": 0
},
"state": "RUNNING",
"type": "capacitySchedulerLeafQueueInfo",
"usedCapacity": 0.0,
"usedResources": "<memory:0, vCores:0>",
"userLimit": 100,
"userLimitFactor": 100.0,
"users": null
}
]
},
"resourcesUsed": {
"memory": 0,
"vCores": 0
},
"state": "RUNNING",
"usedCapacity": 0.0,
"usedResources": "<memory:0, vCores:0>"
},
{
"absoluteCapacity": 89.5,
"absoluteMaxCapacity": 100.0,
"absoluteUsedCapacity": 0.0,
"capacity": 89.5,
"maxCapacity": 100.0,
"numApplications": 2,
"queueName": "b",
"queues": {
"queue": [
{
"absoluteCapacity": 53.7,
"absoluteMaxCapacity": 100.0,
"absoluteUsedCapacity": 0.0,
"capacity": 60.000004,
"maxActiveApplications": 1,
"maxActiveApplicationsPerUser": 100,
"maxApplications": 5370,
"maxApplicationsPerUser": 537000,
"maxCapacity": 100.0,
"numActiveApplications": 1,
"numApplications": 2,
"numContainers": 0,
"numPendingApplications": 1,
"queueName": "b1",
"resourcesUsed": {
"memory": 0,
"vCores": 0
},
"state": "RUNNING",
"type": "capacitySchedulerLeafQueueInfo",
"usedCapacity": 0.0,
"usedResources": "<memory:0, vCores:0>",
"userLimit": 100,
"userLimitFactor": 100.0,
"users": {
"user": [
{
"numActiveApplications": 0,
"numPendingApplications": 1,
"resourcesUsed": {
"memory": 0,
"vCores": 0
},
"username": "user2"
},
{
"numActiveApplications": 1,
"numPendingApplications": 0,
"resourcesUsed": {
"memory": 0,
"vCores": 0
},
"username": "user1"
}
]
}
},
{
"absoluteCapacity": 35.3525,
"absoluteMaxCapacity": 100.0,
"absoluteUsedCapacity": 0.0,
"capacity": 39.5,
"maxActiveApplications": 1,
"maxActiveApplicationsPerUser": 100,
"maxApplications": 3535,
"maxApplicationsPerUser": 353500,
"maxCapacity": 100.0,
"numActiveApplications": 0,
"numApplications": 0,
"numContainers": 0,
"numPendingApplications": 0,
"queueName": "b2",
"resourcesUsed": {
"memory": 0,
"vCores": 0
},
"state": "RUNNING",
"type": "capacitySchedulerLeafQueueInfo",
"usedCapacity": 0.0,
"usedResources": "<memory:0, vCores:0>",
"userLimit": 100,
"userLimitFactor": 100.0,
"users": null
},
{
"absoluteCapacity": 0.4475,
"absoluteMaxCapacity": 100.0,
"absoluteUsedCapacity": 0.0,
"capacity": 0.5,
"maxActiveApplications": 1,
"maxActiveApplicationsPerUser": 100,
"maxApplications": 44,
"maxApplicationsPerUser": 4400,
"maxCapacity": 100.0,
"numActiveApplications": 0,
"numApplications": 0,
"numContainers": 0,
"numPendingApplications": 0,
"queueName": "b3",
"resourcesUsed": {
"memory": 0,
"vCores": 0
},
"state": "RUNNING",
"type": "capacitySchedulerLeafQueueInfo",
"usedCapacity": 0.0,
"usedResources": "<memory:0, vCores:0>",
"userLimit": 100,
"userLimitFactor": 100.0,
"users": null
}
]
},
"resourcesUsed": {
"memory": 0,
"vCores": 0
},
"state": "RUNNING",
"usedCapacity": 0.0,
"usedResources": "<memory:0, vCores:0>"
}
]
},
"type": "capacityScheduler",
"usedCapacity": 0.0
}
}
}
-Fifo Scheduler API
-Fair Scheduler API
获取集群 Applications的 API
通过应用程序API,您可以获得一组资源,每个资源代表一个应用程序。对该资源运行get操作时,将获得应用程序对象的集合.
通过此api可以获得正在运行的applications。
- URI
http://<rm http address:port>/ws/v1/cluster/apps
- HTTP操作支持
get
- 查询参数支持
可以为get操作指定多个参数。开始和完成时间有一个开始和结束参数,允许您指定范围。例如,可以请求在2011年12月19日上午1:00到下午2:00之间启动的所有应用程序,startedTimeBegin=1324256400,startedTimeEnd=1324303200。如果未指定begin参数,则默认为0;如果未指定end参数,则默认为无穷大。
* state [deprecated] - state of the application (application的状态)
* states - applications matching the given application states, specified as a comma-separated list.(与给定应用程序状态匹配的应用程序,指定为逗号分隔的列表)
* finalStatus - the final status of the application - reported by the application itself(应用程序的最终状态-由应用程序本身报告)
* user - user name (用户名)
* queue - queue name (队列名)
* limit - total number of app objects to be returned(要返回的应用程序对象总数)
* startedTimeBegin - applications with start time beginning with this time, specified in ms since epoch
* startedTimeEnd - applications with start time ending with this time, specified in ms since epoch
* finishedTimeBegin - applications with finish time beginning with this time, specified in ms since epoch
* finishedTimeEnd - applications with finish time ending with this time, specified in ms since epoch
* applicationTypes - applications matching the given application types, specified as a comma-separated list.(与给定应用程序类型匹配的应用程序,指定为逗号分隔的列表)
* applicationTags - applications matching any of the given application tags, specified as a comma-separated list.(与任何给定应用程序标记匹配的应用程序,指定为逗号分隔的列表)
* deSelects - a generic fields which will be skipped in the result.(将在结果中跳过的通用字段)
- Elements of the apps (Applications) object
名称 | 类型 | 描述 |
---|---|---|
app | array of app objects(JSON)/zero or more application objects(XML) | application的集合 |
- 请求实例
在这里就以JSON response为例
HTTP Request:
GET http://<rm http address:port>/ws/v1/cluster/apps
可以添加 ?user=*** & state =running等条件
Response Header:
HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
Response Body:
{
"apps":
{
"app":
[
{
"id": "application_1476912658570_0002",
"user": "user2",
"name": "word count",
"queue": "default",
"state": "FINISHED",
"finalStatus": "SUCCEEDED",
"progress": 100,
"trackingUI": "History",
"trackingUrl": "http://host.domain.com:8088/cluster/app/application_1476912658570_0002",
"diagnostics": "...",
"clusterId": 1476912658570,
"applicationType": "MAPREDUCE",
"applicationTags": "",
"priority": -1,
"startedTime": 1476913457320,
"finishedTime": 1476913761898,
"elapsedTime": 304578,
"amContainerLogs": "http://host.domain.com:8042/node/containerlogs/container_1476912658570_0002_02_000001/user2",
"amHostHttpAddress": "host.domain.com:8042",
"allocatedMB": 0,
"allocatedVCores": 0,
"runningContainers": 0,
"memorySeconds": 206464,
"vcoreSeconds": 201,
"queueUsagePercentage": 0,
"clusterUsagePercentage": 0,
"preemptedResourceMB": 0,
"preemptedResourceVCores": 0,
"numNonAMContainerPreempted": 0,
"numAMContainerPreempted": 0,
"logAggregationStatus": "DISABLED",
"unmanagedApplication": false,
"appNodeLabelExpression": "",
"amNodeLabelExpression": "",
"resourceRequests": [
{
"capability": {
"memory": 4096,
"virtualCores": 1
},
"nodeLabelExpression": "",
"numContainers": 0,
"priority": {
"priority": 0
},
"relaxLocality": true,
"resourceName": "*"
},
{
"capability": {
"memory": 4096,
"virtualCores": 1
},
"nodeLabelExpression": "",
"numContainers": 0,
"priority": {
"priority": 20
},
"relaxLocality": true,
"resourceName": "host1.domain.com"
},
{
"capability": {
"memory": 4096,
"virtualCores": 1
},
"nodeLabelExpression": "",
"numContainers": 0,
"priority": {
"priority": 20
},
"relaxLocality": true,
"resourceName": "host2.domain.com"
}]
},
{
"id": "application_1476912658570_0001",
"user": "user1",
"name": "Sleep job",
"queue": "default",
"state": "FINISHED",
"finalStatus": "SUCCEEDED",
"progress": 100,
"trackingUI": "History",
"trackingUrl": "http://host.domain.com:8088/cluster/app/application_1476912658570_0001",
"diagnostics": "...",
"clusterId": 1476912658570,
"applicationType": "YARN",
"applicationTags": "",
"priority": -1,
"startedTime": 1476913464750,
"finishedTime": 1476913863175,
"elapsedTime": 398425,
"amContainerLogs": "http://host.domain.com:8042/node/containerlogs/container_1476912658570_0001_02_000001/user1",
"amHostHttpAddress": "host.domain.com:8042",
"allocatedMB": 0,
"allocatedVCores": 0,
"runningContainers": 0,
"memorySeconds": 205410,
"vcoreSeconds": 200,
"queueUsagePercentage": 0,
"clusterUsagePercentage": 0,
"preemptedResourceMB": 0,
"preemptedResourceVCores": 0,
"numNonAMContainerPreempted": 0,
"numAMContainerPreempted": 0,
"logAggregationStatus": "DISABLED",
"unmanagedApplication": false,
"appNodeLabelExpression": "",
"amNodeLabelExpression": "",
"resourceRequests": [
{
"capability": {
"memory": 4096,
"virtualCores": 1
},
"nodeLabelExpression": "",
"numContainers": 0,
"priority": {
"priority": 0
},
"relaxLocality": true,
"resourceName": "*"
},
{
"capability": {
"memory": 4096,
"virtualCores": 1
},
"nodeLabelExpression": "",
"numContainers": 0,
"priority": {
"priority": 20
},
"relaxLocality": true,
"resourceName": "host3.domain.com"
},
{
"capability": {
"memory": 4096,
"virtualCores": 1
},
"nodeLabelExpression": "",
"numContainers": 0,
"priority": {
"priority": 20
},
"relaxLocality": true,
"resourceName": "host4.domain.com"
}]
}
]
}
}
Cluster Application Statistics(群集应用程序统计信息) API
通过应用程序统计信息API,您可以获得一个三元组集合,每个三元组包含应用程序类型、应用程序状态以及ResourceManager上下文中此类型和此状态的应用程序数。注意,考虑到性能问题,我们目前每个查询最多只支持一个applicationtype。我们将来可能支持每个查询多个应用程序类型以及更多统计信息。对该资源运行get操作时,将获得statitem对象的集合。
- URI
http://<rm http address:port>/ws/v1/cluster/appstatistics
- HTTP操作支持
get
- 查询参数支持
可以指定两个参数。参数不区分大小写。
states -.
applicationTypes -.
- Elements of the appStatInfo (statItems) object
名称 | 类型 | 描述 |
---|---|---|
statItem | array of statItem objects(JSON)/zero or more statItem objects(XML) | The collection of statItem objects |
- 请求实例
在这里就以JSON response为例
HTTP Request:
GET http://<rm http address:port>/ws/v1/cluster/appstatistics?states=accepted,running,finished&applicationTypes=mapreduce
Response Header:
HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
Response Body:
{
"appStatInfo":
{
"statItem":
[
{
"state" : "accepted",
"type" : "mapreduce",
"count" : 4
},
{
"state" : "running",
"type" : "mapreduce",
"count" : 1
},
{
"state" : "finished",
"type" : "mapreduce",
"count" : 7
}
]
}
}
Cluster Application API(集群内某个application的api)
应用程序资源包含有关已提交到群集的特定应用程序的信息。
- URI
http://<rm http address:port>/ws/v1/cluster/apps/{appid}
- HTTP操作支持
get
- 查询参数支持
none
- Elements of the app (Application) object
名称 | 类型 | 描述 |
---|---|---|
id | string | application id |
user | string | 启动application的用户 |
name | string | application 的name |
queue | string | application被提交到的队列 |
state | string | 根据资源管理器的应用程序状态-有效值是yarn应用程序状态枚举的成员: NEW, NEW_SAVING, SUBMITTED, ACCEPTED, RUNNING, FINISHED, FAILED, KILLED |
finalStatus | string | 应用程序的最终状态(如果完成)(由应用程序本身报告)有效值是finalApplicationStatus枚举的成员: UNDEFINED, SUCCEEDED, FAILED, KILLED |
progress | float | application完成的进度百分比 |
trackingUI | string | 跟踪URL当前指向的位置-历史记录(用于历史记录服务器)或ApplicationMaster |
trackingUrl | string | 可用于跟踪应用程序的Web URL |
diagnostics | string | 详细诊断信息 |
clusterId | long | 群集ID |
applicationType | string | application 类型 |
applicationTags | string | application 逗号分隔标记 |
priority | string | 提交申请的优先级 |
startedTime | long | application 启动的时间(从epoch开始以ms为单位) |
finishedTime | long | application完成的事件 毫秒单位 |
elapsedTime | long | application 开始后经过的时间 (in ms) |
amContainerLogs | string | application master container 日志的URL |
amHostHttpAddress | string | The nodes http address of the application master |
amRPCAddress | string | The RPC address of the application master |
allocatedMB | int | The sum of memory in MB allocated to the application’s running containers |
allocatedVCores | int | The sum of virtual cores allocated to the application’s running containers |
runningContainers | int | The number of containers currently running for the application |
memorySeconds | long | The amount of memory the application has allocated (megabyte-seconds) |
vcoreSeconds | long | The amount of CPU resources the application has allocated (virtual core-seconds) |
queueUsagePercentage | float | The percentage of resources of the queue that the app is using |
clusterUsagePercentage | float | The percentage of resources of the cluster that the app is using. |
preemptedResourceMB | long | Memory used by preempted container |
preemptedResourceVCores | long | Number of virtual cores used by preempted container |
numNonAMContainerPreempted | int | Number of standard containers preempted |
numAMContainerPreempted | int | Number of application master containers preempted |
logAggregationStatus | string | Status of log aggregation - valid values are the members of the LogAggregationStatus enum: DISABLED, NOT_START, RUNNING, RUNNING_WITH_FAILURE, SUCCEEDED, FAILED, TIME_OUT |
unmanagedApplication | boolean | Is the application unmanaged. |
appNodeLabelExpression | string | Node Label expression which is used to identify the nodes on which application’s containers are expected to run by default. |
amNodeLabelExpression | string | Node Label expression which is used to identify the node on which application’s AM container is expected to run. |
- 请求实例
在这里就以JSON response为例
HTTP Request:
GET http://<rm http address:port>/ws/v1/cluster/apps/application_1476912658570_0002
Response Header:
HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
Response Body:
{
"app": {
"id": "application_1476912658570_0002",
"user": "user2",
"name": "word count",
"queue": "default",
"state": "FINISHED",
"finalStatus": "SUCCEEDED",
"progress": 100,
"trackingUI": "History",
"trackingUrl": "http://host.domain.com:8088/cluster/app/application_1476912658570_0002",
"diagnostics": "...",
"clusterId": 1476912658570,
"applicationType": "YARN",
"applicationTags": "",
"priority": -1,
"startedTime": 1476913457320,
"finishedTime": 1476913761898,
"elapsedTime": 304578,
"amContainerLogs": "http://host.domain.com:8042/node/containerlogs/container_1476912658570_0002_02_000001/dr.who",
"amHostHttpAddress": "host.domain.com:8042",
"allocatedMB": -1,
"allocatedVCores": -1,
"runningContainers": -1,
"memorySeconds": 206464,
"vcoreSeconds": 201,
"queueUsagePercentage": 0,
"clusterUsagePercentage": 0,
"preemptedResourceMB": 0,
"preemptedResourceVCores": 0,
"numNonAMContainerPreempted": 0,
"numAMContainerPreempted": 0,
"logAggregationStatus": "DISABLED",
"unmanagedApplication": false,
"appNodeLabelExpression": "",
"amNodeLabelExpression": ""
}
}
Cluster Application Attempts API
通过应用程序尝试API,您可以获得表示应用程序尝试的资源集合。在该资源上运行获取操作时,将获取一组应用程序尝试对象。
- URI
http://<rm http address:port>/ws/v1/cluster/apps/{appid}/appattempts
- HTTP操作支持
get
- 查询参数支持
none
- Elements of the appAttempts object
当您请求应用程序尝试列表时,信息将作为应用程序尝试对象的数组返回。
appAttempts:
名称 | 类型 | 描述 |
---|---|---|
appAttempt | array of app attempt objects(JSON)/zero or more app attempt objects(XML) | attempt对象的集合 |
名称 | 类型 | 描述 |
---|---|---|
id | string | The app attempt id |
nodeId | string | 尝试运行的节点的节点ID |
nodeHttpAddress | string | 尝试运行的节点的节点的地址 |
logsLink | string | 尝试运行的节点的节点的日志 |
containerId | string | application 尝试的容器ID |
startTime | long | 尝试的开始时间(MS单位) |
- 请求实例
在这里就以JSON response为例
HTTP Request:
GET http://<rm http address:port>/ws/v1/cluster/apps/application_1326821518301_0005/appattempts
Response Header:
HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
Response Body:
{
"appAttempts" : {
"appAttempt" : [
{
"nodeId" : "host.domain.com:8041",
"nodeHttpAddress" : "host.domain.com:8042",
"startTime" : 1326381444693,
"id" : 1,
"logsLink" : "http://host.domain.com:8042/node/containerlogs/container_1326821518301_0005_01_000001/user1",
"containerId" : "container_1326821518301_0005_01_000001"
}
]
}
}
Cluster Nodes API
使用nodes API,您可以获得一个资源集合,其中每个资源代表一个节点。在该资源上运行get操作时,将获取节点对象的集合。
Cluster Node API
Cluster Writeable APIs
Cluster New Application API
Cluster Applications API(Submit Application)
Cluster Application State API
Cluster Application Queue API
Cluster Application Priority API
Cluster Delegation Tokens API
Cluster Reservation API List
Cluster Reservation API Create
Cluster Reservation API Submit
Cluster Reservation API Update
Cluster Reservation API Delete
Cluster Application Timeouts API
Cluster Application Timeout API
Cluster Application Timeout Update API
Scheduler Configuration Mutation API
- URI
- HTTP操作支持
get
- 查询参数支持
none
- clusterMetrics对象的元素
名称 | 类型 | 描述 |
---|---|---|
- 请求实例
在这里就以JSON response为例
HTTP Request:
Response Header:
HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
Response Body:
没有评论