KairosDB

AttentionThis page documents an earlier version. Go to the latest (v2.1)version.

KairosDB is a Java-based time-series metrics API that leverages Cassandra as it’s underlying distributed database. This page shows how it can be integrated with YugabyteDB’s Cassandra-compatible YCQL API.

1. Start Local Cluster

Follow Quick Start instructions to run a local YugabyteDB cluster. Test YugabyteDB’s Cassandra API as documented so that you can confirm that you have a Cassandra service running on localhost:9042.

2. Download KairosDB

Download KairosDB as stated below. Latest releases are available here.


1. $ wget https://github.com/kairosdb/kairosdb/releases/download/v1.2.0-beta3/kairosdb-1.2.0-0.3beta.tar.gz
2. $ tar xvfz kairosdb-1.2.0-0.3beta.tar.gz
3. $ cd kairosdb/

You can follow the Getting Started to see how to configure KairosDB in general. For the purpose of integrating with the local YugabyteDB cluster running at localhost:9042, simply open conf/kairosdb.properties and comment out the default in-memory datastore as below.


1. #kairosdb.service.datastore=org.kairosdb.datastore.h2.H2Module

Uncomment the following line to make Cassandra the datastore.


1. kairosdb.service.datastore=org.kairosdb.datastore.cassandra.CassandraModule

3. Start KairosDB


1. $ ./bin/kairosdb.sh run

You should see the following lines if KairosDB starts up successfully.


1. 18:34:01.094 [main] INFO  [AbstractConnector.java:338] - Started [email protected]:8080
2. 18:34:01.098 [main] INFO  [Main.java:522] - Starting service class org.kairosdb.core.telnet.TelnetServer
3. 18:34:01.144 [main] INFO  [Main.java:378] - ------------------------------------------
4. 18:34:01.144 [main] INFO  [Main.java:379] -      KairosDB service started
5. 18:34:01.145 [main] INFO  [Main.java:380] - ------------------------------------------

4. Verify Cassandra integration with cqlsh

  • Run cqlsh to connect to the YugabyteDB’s YCQL API.

1. # assuming you are using the macOS or Linux binary
2. $ ./bin/cqlsh localhost
3. Connected to local cluster at 127.0.0.1:9042.
4. [cqlsh 5.0.1 | Cassandra 3.9-SNAPSHOT | CQL spec 3.4.2 | Native protocol v4]
5. Use HELP for help.
6. cqlsh>

  • Run a cql command to verify it is working.

1. cqlsh> describe keyspaces;


1. kairosdb  system_schema  system_auth  system


1. cqlsh> use kairosdb;
2. cqlsh:kairosdb> describe tables;


1. row_keys       data_points    string_index
2. row_key_index  service_index  row_key_time_index

4. cqlsh:kairosdb>

5. Test KairosDB

Push data

Push metric data into KairosDB as per the instructions here.

Query data

Query metric data into KairosDB as per the instructions here.