如何使用yarn resourcemanager restapi终止spark应用程序

gudnpqoy  于 2021-05-27  发布在  Spark
关注(0)|答案(0)|浏览(616)

我正在尝试使用yarn rest资源管理器api来杀死运行在yarn上的spark应用程序。下面是我试图终止应用程序的两个不同的put命令:
第一命令

curl -X PUT 'http://<HOSTNAME>:8088/ws/v1/cluster/apps/<APPLICATION_ID>/state' -d '{"state": "KILLED"}'

结果:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><RemoteException><exception>WebApplicationException</exception><javaClassName>javax.ws.rs.WebApplicationException</javaClassName></RemoteException>

第二命令

curl -v -X PUT -H "Content-Type: application/json" -d '{"state": "KILLED"}' 'http://<HOSTNAME>:8088/ws/v1/cluster/apps/<APPLICATION_ID>/state'

结果:


* About to connect() to <HOSTNAME> port 8088 (#0)
* Trying <IP>...
* Connected to <HOSTNAME> (<IP>) port 8088 (#0)

> PUT /ws/v1/cluster/apps/<APPLICATION_ID>/state HTTP/1.1
> User-Agent: curl/<SOME IP>
> Host: <HOSTNAME>:8088
> Accept: */*
> Content-Type: application/json
> Content-Length: 19
>

* upload completely sent off: 19 out of 19 bytes

< HTTP/1.1 403 Forbidden
< Cache-Control: no-cache
< Expires: Mon, 07 Sep 2020 18:26:46 GMT
< Date: Mon, 07 Sep 2020 18:26:46 GMT
< Pragma: no-cache
< Expires: Mon, 07 Sep 2020 18:26:46 GMT
< Date: Mon, 07 Sep 18:26:46 GMT
< Pragma: no-cache
< Content-Type: application/json
< X-Frame-Options: SAMEORIGIN
< Transfer-Encoding: chunked
< Server: Jetty(<SOME IP>.hwx)
<

* Connection #0 to host <HOSTNAME> left intact

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

我在这里遗漏了什么,或者我需要提供用户名。终止应用程序的正确命令是什么。请建议。
谢谢

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题