问题描述
我试图查看是什么使Chronos优于Crons?我无法完全理解其作业调度和执行体系结构.
I was trying to see what makes Chronos better than Crons? I am not able to understand its job scheduling and executing architecture completely.
具体来说,这些是关于chronos体系结构的问题,我不清楚.
Specifically, these are the questions around chronos architecture that are not clear to me.
- 在一份Chronos文档中,我读到,由于crons具有SPoF,所以crons不好,而cronos更好. chronos如何避免SPoF?
- Chronos中的工作计划保存在哪里?它为此维护某种数据库吗?
- 计划的作业是如何触发的,谁向Chronos发送事件以触发作业?
- 计时作业是否触发了相关作业,如果是,计时作业如何得知父作业何时完成?它可以区分失败的工作和完成的工作吗?
- 我看到chronos中的作业是使用Json格式定义的,使用JSON的任何理由,而不是YAML,Apache Config等其他任何格式.
- 按时间排列的作业可以有多个命令吗?如果是,所有这些不同的命令都将在群集中的同一台计算机上执行吗,或者Chronos甚至可以在群集中的不同计算机上的作业中启动不同的命令?可以并行启动作业中的这些多个命令吗?
- 如果mesos已经具有调度功能,那么为什么甚至需要Chronos? Chronos可以在没有Mesos的情况下运行吗?
- Chronos是否支持基于事件的计划?例如,在创建文件"x"时运行我的工作等.
- 异步运行作业在Chronos中意味着什么?
任何人都可以很好地了解Chronos的体系结构?
Anyone have a good reference for understanding the architecture of Chronos?
推荐答案
您的某些问题在我的答复中得到了回答,所以我将专注于其他未解决的问题.
Some of your questions are answered in my reply here so I will focus on the other questions not addressed.
-
除非您使用Zookeeper,否则Chronos会将状态存储在内存中,在这种情况下,默认情况下它会存储在
/chronos/state
的Zookeeper中,这里的参考.
Chronos stores state in memory unless you are using Zookeeper, in which case it is stored in Zookeeper at
/chronos/state
by default reference here.
请参阅:计时工具:它是如何工作的?
基于lastsuccess
和lastfailure
看到了这里
因为作者决定使用JSON和RESTful API
Because the authors decided to use JSON and a RESTful API
是的. &&&的使用或bash脚本...它们都将在作业运行所在的同一台计算机上执行.不,单个作业不能并行运行命令,但是可以同时安排多个作业.
Yes. The use of && or bash scripts... They will all be executed on the same machine that the job is running on. No, single jobs cannot run the commands in parallel, but multiple jobs could be scheduled at the same time.
因为Chronos适用于可以定期安排的短期cron作业,而Marathon适用于长期任务. Chronos可以很好地替代cron的原因是,它完全依赖于Mesos-这意味着您还可以使用Mesos属性在Mesos集群周围适当地调度作业.请参见此处和此处
Because Chronos is for short-lived cron jobs that can be scheduled on a regular basis, whereas Marathon is for long-lived tasks. The reason Chronos is a good replacement for cron is that it is wholly dependent on Mesos - which means you can also use Mesos attributes to schedule jobs around your Mesos cluster appropriately. See here and here
不是.
异步作业的状态令人怀疑,它看起来像已删除,但不幸的是在文档中仍然有一些参考.
The state of async jobs is suspect, it looks like it was removed but still unfortunately has some references in the documentation.
这篇关于Apache Chronos体系结构说明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!