Chronos

Chronos is a distributed and fault-tolerant job scheduler that run on top of Mesos. Compared to traditional cron jobs, Chronos has many advantages

  • Centralized. No longer do you need to manually ssh into your server and less /var/log to check the status of your cron jobs
  • Distributed. Chronos can run jobs on Mesos slave. This is good for batch processing
  • Fault tolerant. Failed job can be automatically
  • Job dependency. Successful job can trigger other jobs.

Full list of features can be found here https://github.com/mesos/chronos

  • Web UI
  • ISO8601 Repeating Interval Notation
  • Handles dependencies
  • Job Stats (e.g. 50th, 75th, 95th and 99th percentile timing, failure/success)
  • Job History (e.g. job duration, start time, end time, failure/success)
  • Fault Tolerance (leader/follower)
  • Configurable Retries
  • Multiple Workers (i.e. Mesos agents)
  • Native Docker support

Like Marathon, we are going to run Chronos on all Mesos master servers

yum install chronos
systemctl enable chronos
systemctl start chronos

You can then go to the web UI and create jobs. Chronos also provides RESTful APIs for managing jobs.

curl -L -H 'Content-Type: application/json' -X POST http://chronos:4400/v1/scheduler/iso8601  -d '
{
  "name": "chronos-scheduled-job",
  "command": "sleep 60",
  "shell": true,
  "executor": "",
  "executorFlags": "",
  "taskInfoData": "",
  "retries": 2,
  "owner": "[email protected]",
  "ownerName": "",
  "description": "",
  "cpus": 0.1,
  "disk": 256,
  "mem": 128,
  "disabled": true,
  "softError": false,
  "dataProcessingJobType": false,
  "fetch": [],
  "uris": [],
  "environmentVariables": [],
  "arguments": [],
  "highPriority": false,
  "runAsUser": "root",
  "concurrent": false,
  "constraints": [],
  "schedule": "R0/2017-03-22T02:07:39.779Z/PT24H",
  "scheduleTimeZone": ""
}
'

We can start a job that depends on our previous job

bash curl -L -X POST -H 'Content-Type: application/json' http://chronos:4400/v1/scheduler/dependency -d '
{
  "async": true,
  "command": "sleep 100",
  "epsilon": "PT30M",
  "name": "dependent-job",
  "owner": "[email protected]",
  "parents": [
    "chronos-scheduled-job"
  ],
  "retries": 2
}
'

results matching ""

    No results matching ""