Skip to content

Standalone Kronos

manikvenkat edited this page Oct 16, 2019 · 6 revisions

Setting up standalone Kronos

The standalone Kronos web application runs both the scheduler and executor as part of the same process and uses an in-memory queue to exchange messages and RAM store to keep its state.

Prerequisite

  • Ensure Java version 8 or above is installed.

Follow these steps to get started

  • Download distribution of Kronos from release page.
  • Unzip the downloaded distribution and change directory into it.

The distribution of Kronos contains the following directories :

FOLDER DESCRIPTION
sbin scripts to start/ stop Kronos web application
conf configuration files for Kronos web application
lib jars dependencies for Kronos
lib/ext jars dependencies for Kronos extensions
webapp the web files for Kronos web server

In the conf directory there will be these files:

  • scheduler.yaml - Used by scheduler to configure itself. (Read more)
  • executor.yaml - Used by executor to configure itself. (Read more)
  • queue.yaml - Used to configure the messaging queue used by scheduler and executor. (Read more)
  • log4j.properties - Used to configure log4j for logging.

To configure the Kronos web server set the following env variables, the default values are

export HOST="localhost"
export PORT=8080
export HEAP_OPTS="-Xmx128m -Xms128m"
  • Start the Kronos application.
$ ./sbin/kronos.sh start

The Kronos application is running and can be accessed through a browser. This will open a Swagger UI listing available resources.

http://localhost:8080/
  • Stopping Kronos application
$ ./sbin/kronos.sh stop

This concludes setting up standalone Kronos web application which uses an in-memory queue to exchange messages and RAM store to keep its state. This is a lightweight setup which keeps all its data in RAM and thus won't be able to retain its state on restart.

Kronos allows you to plug in a store to persist its state and restore the same on restart. As a reference, we have added a store plugin which uses embedded HSQL DB to persist state on disk.

The HSQL DB store extension is available as part of extensions release distribution. Download all the available Kronos extensions from extensions release page and extract all the jars to the ext folder. Update the Kronos scheduler configuration to use embedded HSQL store to maintain its state across restarts.

Update the scheduler.yaml available under conf dir

storeServiceConfig:
  storeServiceClass: com.cognitree.kronos.scheduler.store.jdbc.EmbeddedHSQLStoreService
  config:
    # directory to keep the kronos data
    dbPath: /tmp
    #username:
    #password:
    #minIdleConnection:
    #maxIdleConnection:

The configuration is explained in detail here.

What next? Head on to running the example guide to schedule a simple workflow executing shell command tasks.