文章目录
- 03 文末
01 引言
Yarn其实是有REST Api
的,很多接口无需使用爬虫去爬页面,具体的接口使用在官网可以看到。
接口地址: https://hadoop.apache.org/docs/current/hadoop-yarn/hadoop-yarn-site/ResourceManagerRest.html
API 目录索引如下:
- Overview
- Enabling CORS support
- Cluster Information API
- Cluster Metrics API
- Cluster Scheduler API
- Cluster Applications API
- Cluster Application Statistics API
- Cluster Application API
- Cluster Application Attempts API
- Containers for an Application Attempt API
- Specific Container for an Application Attempt API
- Cluster Nodes API
- Cluster Node API
- Cluster Node Update Resource 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
- Cluster Container Signal API
- Scheduler Activities API
- Application Activities API
02 常用接口
注意Yarn REST API
同时支持返回JSON
或者XML
格式的文本,只需要在请求头声明即可,比如需要返回XML
(默认返回JSON
,不需要显示声明),则请求头如下:
2.1 指标接口
请求地址:
响应接口:
2.2 应用接口
2.2.1 应用列表接口
请求地址:
返回内容:
2.2.2 应用统计接口
请求地址:
响应内容:
2.2.3 应用详情
请求地址:
响应内容:
2.3 队列接口
请求地址:
响应内容:
2.4 Node节点接口
请求地址:
响应内容:
2.5 其它接口
还有其它的接口就得自己根据实际项目情况去看了,本文不再赘述。
03 文末
本文主要整理了Yarn 相关的 REST API
,并举出了一些例子,希望能帮助到大家,谢谢大家的阅读!