marathon强制删除任务,app、deployment、task



Marathon上的任务可能会因为其他原因,卡在那,不能被删除掉, 一直在deployment。这时候我们需要强制删除掉。

强制杀掉 deployment

删除deployment上的任务,需要知道deployment上的id

1
2
3
4
marathonAddr="http://192.168.0.11:8080";
deployment_id="14eed224-6f75-41fs-8339-ce6a758sdfr32";
apiPath="/v2/deployments/${deployment_id}"
curl -X DELETE ${marathonAddr}${apiPath}?force=true

这样就可以再命令行上删除deployment上的任务了,

强制杀掉 app task

需要知道task的id

1
2
3
4
5
marathonAddr="http://192.168.0.11:8080"";
app_id="shining-test"
task_id="shining-test.8c873ce2-ad63-11e7-a70d-36d30528411f"
apiPath="/v2/apps/${app_id}/tasks/${task_id}"
curl -X DELETE ${marathonAddr}${apiPath}?force=true

例如 删除 job

1
2
3
4
curl -X DELETE http://192.168.0.11:8080/v2/apps/mysql-io-test -H "Content-type: application/json"

强制删除
curl -X DELETE http://192.168.0.11:8080/v2/apps/mysql-io-test?force=true -H "Content-type: application/json"

页面执行删除

进入marathon API 接口

api

deployment delete

api

api

app task delete

api

api

感谢您的支持!