英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论