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

quhf5bfb  于 9个月前  发布在  Hadoop
关注(0)|答案(1)|浏览(127)

我们有一个启用了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”}}

5gfr0r5j

5gfr0r5j1#

你不能简单地在kerberized集群上使用...?user.name=...。相反,您的curl应该通过SPNEGO向RM进行身份验证,这意味着使用curl选项--negotiate--user :。您还需要kinit作为授权用户,在进行REST调用之前可以实际杀死应用程序(应用程序所有者或超级用户)。

相关问题