How to use Chronos on DC/OS

How to use Chronos on DC/OS

Chronos is the “cron” for your Mesosphere DC/OS. It is a highly-available distributed job scheduler, providing the most robust way to run batch jobs in your datacenter. Chronos schedules jobs across the Mesos cluster and manages dependencies between jobs in an intelligent way.

Time Estimate

10 Minutes

Target Audience

  • Data Infrastructure Engineers
  • Data Scientists
  • Devops Engineers

Table of Contents

Prerequisites

  • DC/OS installed
  • DC/OS CLI installed
  • Chronos needs at least 1GB of RAM and 1 CPU core available in the cluster.

Installing Chronos on DC/OS

  1. From the DC/OS CLI, enter this command:

    dcos package install chronos
    

    Tip: You can specify a JSON configuration file along with the Chronos installation command: dcos package install chronos --options=<config_file>. For more information, see the dcos package section of the CLI command reference.

  2. Verify that Chronos is successfully installed

    DC/OS Web Interface

    Go to the Services tab and verify that Chronos shows up in the list as Healthy.

    Chronos in the services view

    DC/OS CLI

    Run this command to view installed services:

    dcos package list
    

    You should see Chronos in the output:

    NAME     VERSION  APP               COMMAND  DESCRIPTION
    chronos  2.4.0    /chronos          ---      A fault tolerant job scheduler for Mesos which handles dependencies and ISO8601 based schedules.
    

Uninstalling Chronos

  1. From the DC/OS CLI, enter this command:

    dcos package uninstall chronos
    
  2. Open the ZooKeeper Exhibitor web interface at <hostname>/exhibitor, where <hostname> is the Mesos Master hostname.

    1. Click on the Explorer tab and navigate to the chronos folder.

      Exhibitor status view

    2. Choose Type Delete, enter the required Username, Ticket/Code, and Reason fields, and click Next.

      Delete the Chronos path from ZooKeeper

    3. Click OK to confirm your deletion.

Appendix: Next Steps


Creating a Scheduled Job

This tutorial shows how to create a scheduled job using Chronos. We’re going to create a job that runs every 10 seconds and prints the current date.