Skip to content
A KairosDB docker image configurable via environment variables
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

A KairosDB Docker image

This directory contains a Dockerfile and some additional source files needed to build a Docker image for KairosDB. The kairosdb container operates against a back-end Cassandra database cluster. The Cassandra nodes are passed to the container on launch.

Cassandra nodes can, for example, be started via the official Cassandra Docker image:

docker run --name cassandra -d -v cassandra-data:/var/lib/cassandra -p 9042:9042 cassandra:3.11

Building the docker image

To build the Docker image, issue the following command (possibly after updating the VERSION variable):


To also push to Docker hub, do

export PUSH=yes

Running a container from the image

Once the docker image is built for the KairosDB server, it can be run with:

docker run -d --name kairosdb -p 4242:4242 -p 8080:8080 -e CASSANDRA_HOSTS="<hostname/ip>" elastisys/kairosdb:1.2.1

Note that a comma-separated list of back-end Cassandra hosts need to be passed through the CASSANDRA_HOSTS environment variable.

This will publish the KairosDB's Telnet port on 4242 and HTTP port on 8080.

There are a number of options that can be used to control the behavior of KairosDB. For example, you can set a replication strategy that suits your Cassandra cluster via the CASSANDRA_REPLICATION environment variable (defaults to {'class': 'SimpleStrategy','replication_factor' : 1}). Refer to the code for details.

Trying it out

The example directory contains a docker-compose.yml file which starts Docker containers with Grafana (with the KairosDB datasoure plugin installed), KairosDB and Cassandra.

cd example/
docker-compose up

Add a kairosdb datasource (URL: http://kairosdb:8080) and you should be ready to add graphs plotting KairosDB metrics.

To insert some dummy metrics, you can make use of the provided example/ script.

./example/ 2018-01-01 2018-01-05
You can’t perform that action at this time.