Issue 1: Inconsistent Mesos Leader Election
Different servers may elect different leaders!!
The cause of this issue is currently unknown, but it is suspected that time discrepancies between machines are to blame.
Issue 2: Marathon Leader Election Error!
I also don’t know where to check who the leader is. In any case, first use NTP to ensure the server times are consistent, then use journal to check the logs, and restart whichever one has the problem.
Issue 3: An App Does Not Leave "Waiting"
Issue 4: App Requires a Specific Port
Set hostPort to a non-zero value in portBindings.
Set requirePorts to true.
Issue 5: When a server running mesos-slave restarts or the mesos-slave service is shut down directly, the task status in Marathon changes to Unscheduled — due to TASK_LOST. At this point, killing the task will fail.
(1) For Marathon 1.4.3 and later, add the following to each app’s definition file:
"unreachableStrategy": {
"inactiveAfterSeconds": 30,
"expungeAfterSeconds": 60
}
At this point, the unreachable task has not yet been expunged.
The default value is 300s, and the minimum is 1s.
expungeAfterSeconds: If a task instance is unreachable for longer than this value, it will be expunged.
An expunged task will be killed if it does not come back.
A task instance is generally marked as unreachable before being expunged.
This value must be greater than inactiveAfterSeconds.
The default value is 600s.
(2) Add the following to the mesos-slave startup command line:
recovery_timeout=1mins
[Results were unsatisfactory]
Issue 6: Marathon Tasks Cannot Start, Deployments Cannot Complete
Checking the mesos-slave logs reveals that the slave ignored the task command because it believes the master that issued the command is not the leader.
However, after this, the task enters a deadlock state; it cannot be killed, and even the appid cannot be stopped.
This is because Marathon receives no ACK for requests regarding the task status or kill requests for that task.
No solution has been found yet.
The only option is to forcefully kill the deployment (or forcefully kill the task; this is untested, but the API exists, so I don’t know if it works).
(1) Forcefully kill the deployment:
marathonAddr="http://abcd:1234";
deployment_id="14eed6d3-6f72-41f4-8329-ce6a7583eb32";
apiPath="/v2/deployments/${deployment_id}"
curl -X DELETE ${marathonAddr}${apiPath}?force=true
# Tested, this method is useless
marathonAddr="http://abcd:1234";
app_id="autodeploy"
task_id="autodeploy.8c873ce2-ad63-11e7-a70d-36d30528411f"
apiPath="/v2/apps/${app_id}/tasks/${task_id}"
curl -X DELETE ${marathonAddr}${apiPath}?force=true&scale=false&wipe=false
Link: https://www.jianshu.com/p/eb6659cdeda8
Source: 绠€涔?br />Copyright belongs to the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.