我在马拉松调度器中测试我的工作,发现马拉松调度器在重新启动马拉松服务(systemctl restart marathon.service)时重新启动我完成的工作。不确定是否缺少任何阻止此行为的配置。我希望这项工作能完成一次。
测试设置-我使用marathon作为调度程序在mesos集群上运行作业。作业配置使用restapi和force=true标志发布到marathon。
作业应运行一次并完成。
作业json-
{
"id": "/test-job",
"cmd": "/bin/ls",
"cpus": 0.25,
"mem": 100,
"disk": 100,
"instances": 1,
"acceptedResourceRoles": [
"mesos-workers"
],
"labels": {
"MARATHON_SINGLE_INSTANCE_APP": "true",
},
"portDefinitions": [],
"user": "nobody",
"backoffSeconds": 2147483647,
"maxLaunchDelaySeconds": 2147483647,
}
还通过在升级策略的作业定义中添加其他参数进行了测试-
"upgradeStrategy": {
"maximumOverCapacity": 0,
"minimumHealthCapacity": 0
}
任何有助于找出错误的地方都将不胜感激。
谢谢!
重新启动马拉松服务后的马拉松日志-
Sep 25 20:45:04 10.162.217.171 marathon[2801]: [2018-09-25 20:45:04,878] INFO removing matcher ActorOfferMatcher(Actor[akka://marathon/user/launchQueue/1/0-test-job#203351593]) (mesosphere.marathon.core
Sep 25 20:45:04 10.162.217.171 marathon[2801]: [2018-09-25 20:45:04,891] INFO Processing LaunchEphemeral(Instance(instance [test-job.marathon-e18878ba-c103-11e8-a594-12d685c81d52],AgentInfo(10.162.147.2
Sep 25 20:45:04 10.162.217.171 marathon[2801]: [2018-09-25 20:45:04,905] INFO Finished processing 1bf99832-7f87-4609-b591-8261ed4739eb-O630667 from 10.162.147.203. Matched 1 ops after 2 passes. First 10: cpus(
Sep 25 20:45:04 10.162.217.171 marathon[2801]: [2018-09-25 20:45:04,948] WARN The version of ZooKeeper being used doesn't support Container nodes. CreateMode.PERSISTENT will be used instead. (org.apache.curato
Sep 25 20:45:05 10.162.217.171 marathon[2801]: [2018-09-25 20:45:05,113] INFO Received status update for task test-job.e18878ba-c103-11e8-a594-12d685c81d52: TASK_STARTING () (mesosphere.marathon.Maratho
Sep 25 20:45:05 10.162.217.171 marathon[2801]: [2018-09-25 20:45:05,145] INFO Acknowledge status update for task test-job.e18878ba-c103-11e8-a594-12d685c81d52: TASK_STARTING () (mesosphere.marathon.core
Sep 25 20:45:05 10.162.217.171 marathon[2801]: [2018-09-25 20:45:05,149] INFO Received status update for task test-job.e18878ba-c103-11e8-a594-12d685c81d52: TASK_RUNNING () (mesosphere.marathon.Marathon
Sep 25 20:45:05 10.162.217.171 marathon[2801]: [2018-09-25 20:45:05,163] INFO Acknowledge status update for task test-job.e18878ba-c103-11e8-a594-12d685c81d52: TASK_RUNNING () (mesosphere.marathon.core.
Sep 25 20:45:05 10.162.217.171 marathon[2801]: [2018-09-25 20:45:05,405] INFO Received status update for task test-job.e18878ba-c103-11e8-a594-12d685c81d52: TASK_FINISHED (Command exited with status 0)
Sep 25 20:45:05 10.162.217.171 marathon[2801]: [2018-09-25 20:45:05,409] INFO all tasks of instance [test-job.marathon-e18878ba-c103-11e8-a594-12d685c81d52] are terminal, requesting to expunge (mesosphe
Sep 25 20:45:05 10.162.217.171 marathon[2801]: [2018-09-25 20:45:05,426] INFO Removed app [/test-job] from tracker (mesosphere.marathon.core.task.tracker.InstanceTracker$InstancesBySpec:marathon-akka.ac
Sep 25 20:45:05 10.162.217.171 marathon[2801]: [2018-09-25 20:45:05,430] INFO receiveInstanceUpdate: instance [test-job.marathon-e18878ba-c103-11e8-a594-12d685c81d52] was deleted (Finished) (mesosphere.
Sep 25 20:45:05 10.162.217.171 marathon[2801]: [2018-09-25 20:45:05,432] INFO initiating a scale check for runSpec [/test-job] due to [instance [test-job.marathon-e18878ba-c103-11e8-a594-12d685c8
Sep 25 20:45:05 10.162.217.171 marathon[2801]: [2018-09-25 20:45:05,433] INFO Acknowledge status update for task test-job.e18878ba-c103-11e8-a594-12d685c81d52: TASK_FINISHED (Command exited with status
Sep 25 20:45:05 10.162.217.171 marathon[2801]: [2018-09-25 20:45:05,436] INFO Increasing delay. Task launch delay for [/test-job - 2018-09-24T21:51:25.894Z] is set to 24855 days 3 hours 14 minutes 7 sec
Sep 25 20:45:05 10.162.217.171 marathon[2801]: [2018-09-25 20:45:05,437] INFO Need to scale /test-job from 0 up to 1 instances (mesosphere.marathon.SchedulerActions:scheduler-actions-thread-0)
Sep 25 20:45:05 10.162.217.171 marathon[2801]: [2018-09-25 20:45:05,446] INFO Stopped InstanceLauncherActor for /test-job version 2018-09-24T21:51:25.894Z (mesosphere.marathon.core.launchqueue.impl.Task
Sep 25 20:45:05 10.162.217.171 marathon[2801]: [2018-09-25 20:45:05,450] WARN Got unexpected terminated for runSpec /test-job: Actor[akka://marathon/user/launchQueue/1/0-test-job#203351593] (meso
1条答案
按热度按时间2ekbmq321#
marathon应该是一个用于长时间运行的应用程序/进程的框架(因此命名为marathon)。换句话说,它不适合计划或一次性作业/流程。为了过度简化,marathon在无限循环中为每个应用程序执行以下操作
因此,无论您是否重新启动马拉松,如果前一个任务完成,它都将启动一个新任务
我建议您使用设计用于启动作业的框架之一:
克洛诺斯:https://mesos.github.io/chronos/
厨师:https://github.com/twosigma/cook
节拍器:https://github.com/dcos/metronome