yarn提供了rest api 可以监控,管理跑在yarn上的任务。可以通过这些rest api 管理,监控spark on yarn任务
以下的几个简单操作:
官方详细rest api地址:https://hadoop.apache.org/docs/r2.9.2/hadoop-yarn/hadoop-yarn-site/ResourceManagerRest.html
![70861ddd26c846f6eeddf396410a3064.png](https://i-blog.csdnimg.cn/blog_migrate/ed38069284de9789b21a5b40f8924ad0.jpeg)
一.spark任务监控
1.监控指定应用:curl -s "http://rm2.yarn.ns1.svc.xx.com:8088/ws/v1/cluster/apps/application_1571703359463_86564"
为resourceManager地址:rm2.yarn.ns1.svc.xx.com
2.监控用户为dayueet的任务:
http://rm2.yar.xx.xx.com:8088/ws/v1/cluster/apps?user=dayueet
3.监控正在运行的dayueet用户提交的任务
http://rm2.yarn.xx.xx.com:8088/ws/v1/cluster/apps?user=dayueet&state=running
二.rest api 提交任务
You can use the Submit Application API to submit applications. For example:<