如何使用资源管理器 REST API 终止 YARN 作业

huangapple go评论68阅读模式
英文:

How to kill YARN job using Resource Manager REST API

问题

我们有一个启用了Kerberos的EMR集群。我想通过另一个应用程序使用RM API 杀死YARN作业。

curl -v -X PUT -H "Content-Type: application/json" -d '{"state": "KILLED"}' "http://x.x.x.x:8088/ws/v1/cluster/apps/application_id/state?user.name=hadoop"

我们遇到了以下错误。

{"RemoteException":{"exception":"ForbiddenException","message":"java.lang.Exception: 默认静态用户无法执行此操作。","javaClassName":"org.apache.hadoop.yarn.webapp.ForbiddenException"}}

英文:

we have a kerberos enabled EMR cluster. I would like to kill yarn jobs using RM API through an other application.

curl -v -X PUT -H "Content-Type: application/json" -d '{"state": "KILLED"}' "http://x.x.x.x:8088/ws/v1/cluster/apps/application_id/state?user.name=hadoop"

we are getting below error.

> {"RemoteException":{"exception":"ForbiddenException","message":"java.lang.Exception:
> The default static user cannot carry out this
> operation.","javaClassName":"org.apache.hadoop.yarn.webapp.ForbiddenException"}}

答案1

得分: 1

你不能简单地在一个启用了Kerberos认证的集群上使用...?user.name=...。相反,你的curl请求应该通过SPNEGO进行身份验证,这意味着要使用curl选项--negotiate--user : 。在发起REST请求之前,你还需要以一个有权杀死应用程序的授权用户身份使用kinit(可能是应用程序所有者或超级用户)。

英文:

You can't simply use ...?user.name=... on a kerberized cluster. Instead, your curl should authenticate to RM via SPNEGO, and that means using curl options --negotiate and --user : . You would also need to kinit as an authorized user who can actually kill the application (app owner or super-user) before making a REST call.

huangapple
  • 本文由 发表于 2023年8月5日 02:18:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/76838326.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定