问题描述
我正在尝试与Marathon一起执行一次性任务.我能够运行任务容器,但是在task命令完成之后,马拉松运行另一个任务,依此类推.如何防止Marathon运行多个任务/命令?
I'm trying to run a one-off task with Marathon. I'm able to get the task container running, but after the task command completes, marathon runs another task, and so on. How can I prevent Marathon from running more than one task/command?
或者,如果马拉松无法做到这一点,我该如何实现所需的行为?
Or, if this is not possible with Marathon, how can I achieve the desired behaviour?
推荐答案
作为一种hack,您可以在结尾处终止马拉松任务,如此处所示:"> https://github.com/mesosphere/marathon/issues/344#issuecomment-86697361
As a hack you can kill a marathon task at the end, as suggested here: https://github.com/mesosphere/marathon/issues/344#issuecomment-86697361
正如rukletsov已经提到的那样-马拉松运动是长期任务的代名词: https://stackoverflow.com/a/26647789/1047843
As rukletsov already mentioned - Marathon is desigend for long-running tasks: https://stackoverflow.com/a/26647789/1047843
如果Chronos不适合您的情况,则可以将Jenkins与Mesos插件配合使用: https://github.com/jenkinsci/mesos-plugin
If Chronos doesn't fit in your situation you can use Jenkins with Mesos plugin: https://github.com/jenkinsci/mesos-plugin
或者您可以尝试直接与Mesos交谈并编写您自己的框架: http://mesos.apache.org/documentation/latest/app-framework-development-guide/
Or you can try to talk with Mesos directly and write you own framework: http://mesos.apache.org/documentation/latest/app-framework-development-guide/
我认为最简单的两个选择是Chronos和Jenkins.
In my opinion the two easiest options would be Chronos and Jenkins.
这篇关于如何使用Apache Mesos/Marathon运行一次性任务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!