How to deploy Charmed Apache Cassandra¶
This guide walks you through deploying the IAAS/VM operator with the Juju CLI and verifying the deployment by connecting to the cluster. You will:
Set up a Juju controller
Set up a Juju model
Deploy Charmed Apache Cassandra
Verify the deployment by connecting to the cluster
If you already have a Juju controller and a Juju model, you can skip the associated steps.
Juju controller setup¶
Make sure you have a Juju controller accessible from your local environment using the Juju client snap.
List available controllers:
juju list-controllers
Make sure that the controller’s back-end cloud is not Kubernetes-based. To retrieve the cloud list:
juju list-clouds
To switch to another controller if needed:
juju switch <controller>
If there are no suitable controllers, create a new one:
juju bootstrap <cloud> <controller>
where <cloud> is the cloud to deploy the controller to (for example, localhost for a LXD
cloud). For more information on how to set up a new cloud, see the
How to manage clouds
guide in Juju documentation.
Juju model setup¶
Switch to an existing Juju model:
juju switch <model-name>
Or create a new Juju model:
juju add-model <model>
Deploy Charmed Apache Cassandra¶
Note
Charmed Apache Cassandra is still under active development and is only available on the 5/edge
channel. Due to the lack of a stable release it is not yet recommended for production environments.
To deploy Charmed Apache Cassandra:
juju deploy cassandra -n <units> --config profile=<profile> --channel 5/edge
The charm supports two profiles:
production(default) — tunes Cassandra for maximum performance, allocating up to 8 GB RAM per unit for the Java heap. More RAM might be needed for read caches, bloom filters, etc.testing— minimises resource requirements for very small, non-production test and staging clusters
To maintain high availability of the data, 3+ units are recommended.
Warning
Typical production profile servers need at least 32 GB of ECC RAM per unit.
See Apache Cassandra documentation for more details.
To change the profile on a running deployment:
juju config cassandra profile=testing
Monitor the status of the deployment:
watch juju status
During bootstrap, units briefly show maintenance and waiting statuses such as
installing Cassandra, waiting for Cassandra to start, and waiting for cluster to start.
The deployment should be complete once all the units show active and idle status.
Test by connecting¶
Authentication is enabled by default. To retrieve the password for the default operator user:
juju show-secret --reveal "cassandra-peers.<application name>.app" --format json \
| jq -r '.[].content.Data."operator-password"'
Once you have the password, connect to the cluster.
Install cqlsh locally:
sudo snap install cqlsh
Then connect to the cluster:
cqlsh <unit-ip> -u operator -p "<password>"
Alternatively, the charmed-cassandra snap bundles the same client as charmed-cassandra.cqlsh.
Output example
[cqlsh 5.0.1 | Cassandra 5.0.5 | CQL spec 3.4.7 | Native protocol v5]
Use HELP for help.
operator@cqlsh>
If you want to test it further, run some commands in the cqlsh prompt:
operator@cqlsh> CREATE KEYSPACE hello
... WITH replication = {
... 'class': 'SimpleStrategy',
... 'replication_factor': 1
... };
operator@cqlsh> DESCRIBE KEYSPACE hello;
CREATE KEYSPACE hello WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true;