Setting up Reaper using DataStax Astra as a backend

DataStax Astra is a database-as-a-service (DBaaS) for Apache Cassandra. It is available on AWS, GCP and Azure. Starting with version 2.1, Reaper can use DataStax Astra as a serverless storage backend for its data. In this post, we will walk you through the steps for setting it up in just a few minutes.

Setting up Reaper with the Astra backend

Setting up Reaper for non testing use requires to use a persistent storage backend. Currently, Reaper supports h2, postgres and Cassandra. When using Cassandra, the following question usually arises: Should I store Reaper’s data on the cluster I’m repairing or should I spin up a separate cluster for that use?
Astra to the rescue! We will now show you how to leverage Astra’s free tier to use it as a painless storage backend for Reaper.

First of all, sign up for an account on astra.datastax.com. You can use OAuth to sign up with either your GitHub account or your Google account for easy setup.

Once signed up, leave the free tier selected (which will run in GCP exclusively) and click on the Configure button:

Astra plan selection

Large Reaper installations might require to upgrade to the A5 “Dev and test” which can run in both AWS and GCP. This would be more suitable for Reaper instances that need to repair tens of keyspaces per day (the number of clusters doesn’t really matter here). Reaper has very low requirements for data storage and both the free and the A5 plans will be more than enough.

Fill in your database name (to your liking), the keyspace name (usually reaper_db) and the credentials to access your Astra database after creation.
Once your database appears as active on your dashboard, click on the Connect button:

Astra dashboard

Select Driver as connection method and click on the Download Secure Connect Bundle:

Astra secure bundle

Unpack the downloaded bundle and you should have the following files available:

Astra secure bundle contents

Open the config.json file to get the data we’ll need to configure Reaper:

Astra config json

We’ll use the cql_port, keyStorePassword and trustStorePassword values as well as the identity.jks and trustStore.jks files to configure Reaper.

On your Reaper instance(s), check that you have the following files under /etc/cassandra-reaper/configs:

/etc/cassandra-reaper/configs$ ls -lrt
total 52
-rw-r--r-- 1 root root 3867 Oct 16 11:56 cassandra-reaper.yaml
-rw-r--r-- 1 root root 1430 Oct 16 11:56 cassandra-reaper-ssl.properties
-rw-r--r-- 1 root root 3962 Oct 16 11:56 cassandra-reaper-postgres.yaml
-rw-r--r-- 1 root root 3840 Oct 16 11:56 cassandra-reaper-memory.yaml
-rw-r--r-- 1 root root 3936 Oct 16 11:56 cassandra-reaper-h2.yaml
-rw-r--r-- 1 root root 4461 Oct 16 11:56 cassandra-reaper-cassandra.yaml
-rw-r--r-- 1 root root 4560 Oct 16 11:56 cassandra-reaper-cassandra-ssl.yaml
-rw-r--r-- 1 root root 4269 Oct 16 11:56 cassandra-reaper-cassandra-sidecar.yaml
-rw-r--r-- 1 root root 4347 Oct 16 11:56 cassandra-reaper-astra.yaml

Copy cassandra-reaper-astra.yaml and cassandra-reaper-ssl.properties up one level to /etc/cassandra-reaper/ and there rename cassandra-reaper-astra.yaml as cassandra-reaper.yaml:

/etc/cassandra-reaper/configs$ sudo cp cassandra-reaper-astra.yaml ../cassandra-reaper.yaml 
/etc/cassandra-reaper/configs$ sudo cp cassandra-reaper-ssl.properties ..

Upload identity.jks and trustStore.jks from the bundle to /etc/cassandra-reaper. Check that Reaper settings in cassandra-reaper.yaml match your requirements (pay attention to datacenterAvailability) and go down to the cassandra section to fill in the missing parts (contactPoints and port):

cassandra:
  clusterName: "reaper"
  contactPoints: ["72317384-f44c-4a91-971a-1a45e505222c-europe-west1.db.astra.datastax.com"]
  keyspace: reaper_db
  port: 30093
  authProvider:
    type: plainText
    username: reaper
    password: ReaperOnAstraRocks
  ssl:
    type: jdk
  loadBalancingPolicy:
    type: tokenAware
    shuffleReplicas: true
    subPolicy:
      type: dcAwareRoundRobin
      localDC:
      usedHostsPerRemoteDC: 0
      allowRemoteDCsForLocalConsistencyLevel: false

Then edit cassandra-reaper-ssl.properties to set up the truststore and keystore:

-Djavax.net.ssl.keyStore=/etc/cassandra-reaper/identity.jks
-Djavax.net.ssl.keyStorePassword=Y5D6aWJZd1GMP8T0S

-Djavax.net.ssl.trustStore=/etc/cassandra-reaper/trustStore.jks
-Djavax.net.ssl.trustStorePassword=HEiSPJB1G4u0Qn65d

Now start Reaper using sudo service cassandra-reaper start or any appropriate command for your system, and voilà!

You can now use Reaper with a serverless (and in many cases, free) storage backend. You’ll see through the integrated Grafana dashboard that Reaper will have a hard time using much storage:

Astra metrics

Conclusion

DataStax Astra simplifies Reaper deployments, providing an easy to setup, zero maintenance storage backend.
Don’t forget to check our Reaper 2.1 release blog post to read about the highlights of the new version.

cassandra reaper repair astra