Skip to content

How to Deploy Cassandra

Introduction

Cassandra is an open-source distributed database. Deploying Cassandra on Klutch.sh provides scalable, secure infrastructure for your data, with support for persistent storage and automated CI/CD.


Prerequisites

  • A Klutch.sh account (sign up here)
  • A GitHub repository for your Cassandra deployment
  • Basic knowledge of Docker and distributed database concepts

1. Prepare your Cassandra repository

  • Fork or clone the Cassandra repository, or create a wrapper repo for your customizations.
  • Store database and configuration files outside the Git repo; use persistent volumes or object storage and mount or fetch them at runtime.

Refer to the Klutch.sh Quick Start Guide for repository setup and GitHub integration.


2. Deploy without a Dockerfile

  • Connect your GitHub repo to Klutch.sh and select the Cassandra service.
  • Configure build settings and environment variables for your deployment.
  • Set up persistent volumes for database and configuration.

3. Deploy with a Dockerfile

Sample Dockerfile:

FROM cassandra:latest
COPY . /app/
  • Map persistent volumes for database and configuration:
    • /app/data
    • /app/config

4. Persistent Storage

  • Use Klutch.sh volumes for database and configuration files.
  • Example volume mapping:
    • /app/data:/data/data
    • /app/config:/data/config

5. Environment Variables

  • Configure Cassandra settings via environment variables:
    • DB_HOST
    • DB_DATABASE
    • DB_USERNAME
    • DB_PASSWORD

6. Scaling and Production

  • Scale deployment by increasing replica count in Klutch.sh.
  • Monitor logs and resource usage.
  • Use persistent storage for database and configuration.

Resources