Overview
This template provides a production‑ready Apache Cassandra instance as a Monk runnable. You can:- Run it directly to get a managed Cassandra container with sensible defaults
- Inherit it in your own runnable to seamlessly add a distributed wide-column NoSQL database to your stack
What this template manages
- Cassandra container (
cassandraimage, configurable tag) - Network service on port 9042 (CQL native transport)
- Persistent volumes for data storage
- Authentication configuration
Quick start (run directly)
- Load templates
- Run Cassandra with defaults
- Customize credentials (recommended via inheritance)
variables. Secrets added with monk secrets add will not affect this runnable unless you inherit it and reference those secrets.
- Preferred: inherit and replace variables with
secret("...")as shown below. - Alternative: fork/clone and edit the
variablesincassandra/cassandra.yml, thenmonk load MANIFESTand run.
localhost:9042 (or the runnable hostname inside Monk networks) using CQL.
Configuration
Key variables you can customize in this template:${monk-volume-path}/cassandra on the host.
Use by inheritance (recommended for apps)
Inherit the Cassandra runnable in your application and declare a connection. Example:Ports and connectivity
- Service:
cassandraon TCP port9042(CQL native transport) - From other runnables in the same process group, use
connection-hostname("\<connection-name>")to resolve the DB host.
Persistence and configuration
- Data path:
${monk-volume-path}/cassandra:/var/lib/cassandra - Cassandra stores all keyspaces, tables, and data in this directory
Related templates
- Cassandra cluster: see the
cassandra-cluster/template in this repository for a multi-node cluster setup with seed nodes - Combine with
spark/for analytics workloads - Use with
prometheus-grafana/for monitoring and metrics
Troubleshooting
- Cassandra may take several minutes to start, especially on first launch
- If you changed
cassandra-passwordbut the container has existing data, authentication may fail. Either reset the data volume or update the password inside Cassandra to match. - Ensure the host volumes are writable by the container user.
- Check logs: