问题
I was trying to see what makes Chronos better than Crons? I am not able to understand its job scheduling and executing architecture completely.
Specifically, these are the questions around chronos architecture that are not clear to me.
- In one of the Chronos documentation I read that since crons has SPoF, crons are bad and cronos is better. How chronos avoids SPoF?
- Where are job schedules saved in Chronos? Does it maintain some sort of DB for that?
- How scheduled jobs are triggered, who sends an event to Chronos to trigger the job?
- Are dependent jobs triggered by chronos, if yes how chronos even know when the parent job is completed? Can it distinguish failed jobs from completed ones?
- I saw that jobs in chronos are defined using Json format, any reason for using JSON and not any other format like YAML, Apache Config etc.
- Can a job in chronos have multiple commands? If yes will all these different commands be executed on same machine in cluster or Chronos can even launch different commands in a job in different machines in cluster? Can these multiple commands inside job be launched in parallel?
- If mesos already has a scheduling capability then why Chronos is even required? Can Chronos run without Mesos?
- Does Chronos support event based scheduling? For example run my job when file 'x' is created etc.
- What does async run of a job mean in Chronos?
Anyone have a good reference for understanding the architecture of Chronos?
回答1:
Some of your questions are answered in my reply here so I will focus on the other questions not addressed.
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.See: Chronos: How does it work?
Based on
lastsuccess
andlastfailure
seen hereBecause the authors decided to use JSON and a RESTful API
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.
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
Nope.
The state of async jobs is suspect, it looks like it was removed but still unfortunately has some references in the documentation.
来源:https://stackoverflow.com/questions/51492654/apache-chronos-architecture-explaination