从文档中可以看出,当一个节点进入mesos节点进入维护模式时,它会向所有框架发送反向报价。我对这一点的解释是,框架(如marathon)应该接收那些反向的提议,并将任务从计划维护的节点迁移出去。
我使用api计划60秒后的维护:
curl -X POST leader.mesos:5050/maintenance/schedule \
--data '{"windows": [{"machine_ids":[{"hostname": "host43.local"}], "unavailability": {"start": {"nanoseconds": '$(($(date +%s) + 60))'000000000}, "duration": {"nanoseconds": 3600000000000}}}]}'
然后,我查询维护状态并确认它正在排水:
$ curl leader.mesos:5050/maintenance/status | jq .
{
"draining_machines": [
{
"id": {
"hostname": "host43.local"
}
}
]
}
最后,当Windows靠近时,我放下它:
curl -X POST leader.mesos:5050/machine/down --data '[{"hostname": "host43.local"}]'
我确认它生效了:
$ curl leader.mesos:5050/maintenance/status | jq .
{
"down_machines": [
{
"hostname": "hsot43.local"
}
]
}
然后,我检查marathon(通过ui),并看到仍有任务在运行 host43.local
.
我在marathon日志中看到这个错误消息,我想知道它是否相关:
May 12 11:46:02 host43.local start[126170]: [2016-05-12 11:46:02,581] ERROR not currently active (Actor[akka://marathon/user/taskTracker#-1732573467]) (akka.actor.OneForOneStrategy:marathon-akka.actor.default-dispatcher-17)
May 12 11:46:02 host43.local start[126170]: java.lang.IllegalStateException: not currently active (Actor[akka://marathon/user/taskTracker#-1732573467])
May 12 11:46:02 host43.local start[126170]: at mesosphere.marathon.core.leadership.impl.WhenLeaderActor$$anonfun$1.applyOrElse(WhenLeaderActor.scala:38) ~[marathon-assembly-1.1.1.jar:1.1.1]
May 12 11:46:02 host43.local start[126170]: at akka.actor.Actor$class.aroundReceive(Actor.scala:465) ~[marathon-assembly-1.1.1.jar:1.1.1]
May 12 11:46:02 host43.local start[126170]: at mesosphere.marathon.core.leadership.impl.WhenLeaderActor.aroundReceive(WhenLeaderActor.scala:20) ~[marathon-assembly-1.1.1.jar:1.1.1]
May 12 11:46:02 host43.local start[126170]: at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516) ~[marathon-assembly-1.1.1.jar:1.1.1]
May 12 11:46:02 host43.local start[126170]: at akka.actor.ActorCell.invoke(ActorCell.scala:487) ~[marathon-assembly-1.1.1.jar:1.1.1]
May 12 11:46:02 host43.local start[126170]: at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:254) ~[marathon-assembly-1.1.1.jar:1.1.1]
May 12 11:46:02 host43.local start[126170]: at akka.dispatch.Mailbox.run(Mailbox.scala:221) ~[marathon-assembly-1.1.1.jar:1.1.1]
May 12 11:46:02 host43.local start[126170]: at akka.dispatch.Mailbox.exec(Mailbox.scala:231) ~[marathon-assembly-1.1.1.jar:1.1.1]
May 12 11:46:02 host43.local start[126170]: at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) ~[marathon-assembly-1.1.1.jar:1.1.1]
May 12 11:46:02 host43.local start[126170]: at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) ~[marathon-assembly-1.1.1.jar:1.1.1]
May 12 11:46:02 host43.local start[126170]: at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [marathon-assembly-1.1.1.jar:1.1.1]
May 12 11:46:02 host43.local start[126170]: at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) [marathon-assembly-1.1.1.jar:1.1.1]
May 12 11:46:02 host43.local start[126170]: [2016-05-12 11:46:02,581] INFO Killing 1 instances from 1 (mesosphere.marathon.upgrade.TaskKillActor:marathon-akka.actor.default-dispatcher-17)
如果我用marathon手动终止任务,它们似乎不会在正在维护的节点上分配。似乎行为应该是节点自动迁移出去,我不知道我做错了什么,或者我遇到了错误,或者我误解了文档和预期的行为。
跑马拉松1.1.1和mesos 0.28
1条答案
按热度按时间fumotvh31#
从dc/os slack聊天室收到了一个答案,并将其发布在此处以方便其他人。marathon还不支持mesos维护原语。
以下jira票证跟踪该功能:
https://jira.mesosphere.com/browse/marathon-3216