Automating Backup of Cassandra Clusters in Kubernetes with Medusa

Backing up and restoring a distributed database like Apache Cassandra can be a challenging task. This is why the Cassandra community built Medusa - a utility for managing Cassandra backups.

Medusa is a command-line tool for backing up and restoring Apache Cassandra databases. K8ssandra integrates Medusa into its ecosystem using a Helm interface. So, you use Helm commands to backup and restore Cassandra data. Medusa is capable of full and incremental backups, as well as backing up specific keyspaces. You can store backup data using a cloud provider such as AWS or GCP, or you can use your own storage manager via Minio, an open-source, Kubernetes-native AWS compatible object storage manager.

How Does Medusa Fit Into The K8ssandra Ecosystem?

How Does Medusa Fit Into The K8ssandra Ecosystem?

Medusa is another useful component in the K8ssandra ecosystem that enables you to perform backups of your Cassandra cluster. Medusa is integrated into K8ssandra with a Helm interface. Medusa stores backup data in a storage manager such as AWS, GCP or Minio. You use a Kubernetes secret holding the storage manager’s credentials to give Medusa access to the storage manager and configure Medusa for the storage manager.

Next: How Do I configure and Install Medusa?

How Do I Configure And Install Medusa?

You can use a file to modify the default values for Medusa, and then apply these changes during install, or by performing an upgrade. In the configuration file, you can specify parameters like the storage mechanism, the bucket name and the secret containing the storage credentials.

There are three steps to setting up Medusa within K8ssandra:

With the storage manager setup, the secret created and the configuration file organized, you then use Helm to install or upgrade your K8ssandra cluster configuration.

There are three steps to setting up Medusa within K8ssandra:

  1. Set up a storage manager such as AWS’s S3 and create a bucket (i.e., a storage container within the storage manager).
  2. Create a Kubernetes secret containing the credentials for the storage manager.
  3. Create a Helm configuration file that enables Medusa, and identifies the storage manager, the corresponding secret that contains the credentials for the storage manager, and the target bucket within the storage manager.
Next: How do I perform a backup?
How Do I Configure And Install Medusa?
How Do I Perform A Backup?

How Do I Perform A Backup?

Within K8ssandra, you use Helm to perform backup and restore operations. The backup and restore Helm operations are part of the same Helm chart used to install K8ssandra. To perform a backup, you install a Helm release, which creates a CassandraBackup resource representing your backup data. Since your backup data looks like a CassandraBackup CRD, you can use kubectl to list these objects.

A restore command looks a lot like a backup command. It uses Helm with a couple of different options, such as the restore helm chart name and the backup.name option to identify the backup data.

More Resources

Items related to Kubernetes

K8ssandra docs

K8ssandra docs

An overview of K8ssandra

Learn More
Medusa repo

Medusa repo

Apache Cassandra Backup and Restore Tool

Read More
Blog: TLP's discussion of Medusa

Blog: TLP's discussion of Medusa

Spotify and The Last Pickle : Challenges to Backing Up Cassandra databases

Read More