The problem maybe caused by Mesos and Marathon out of sync, but the solution mentioned on GitHub doesn't work for me.
When I found the orphaned tasks:
What I do is:
restart Marathon
Marathon does not sync orphaned tasks, but start new tasks.
Orphaned tasks still took the resources, so I have to delete them.
I find all orphaned tasks under framework
ef169d8a-24fc-41d1-8b0d-c67718937a48-0000
,curl -XGET `http://c196:5050/master/frameworks
shows that framework is
unregistered_frameworks
:{ "frameworks": [ ..... ], "completed_frameworks": [ ], "unregistered_frameworks": [ "ef169d8a-24fc-41d1-8b0d-c67718937a48-0000", "ef169d8a-24fc-41d1-8b0d-c67718937a48-0000", "ef169d8a-24fc-41d1-8b0d-c67718937a48-0000" ] }
Try to delete framework by framework ID (so that the tasks under framework would be delete too)
curl -XPOST http://c196:5050/master/teardown -d 'frameworkId=ef169d8a-24fc-41d1-8b0d-c67718937a48-0000'
but get
No framework found with specified ID
So, how to delete orphaned tasks?