CCM is a script/library to create, launch and remove an Apache Cassandra or ScyllaDB cluster on localhost. This is ScyllaDB's fork with enhanced support for Scylla, including:
- Relocatable packages - Download and use pre-built Scylla packages from S3
- Docker support - Run Scylla clusters using Docker images
- Unified packages - Simplified installation with all-in-one packages
The goal of ccm is to make it easy to create, manage and destroy a small Scylla cluster on a local box for testing purposes.
# Create cluster with a released version
$ ccm create my_cluster --scylla -n 3 -v release:2024.2 -s
# Check cluster status
$ ccm status
Cluster: 'my_cluster'
-----------------
node1: UP
node2: UP
node3: UPThe nodes will be available at 127.0.0.1, 127.0.0.2 and 127.0.0.3.
# Using a specific build timestamp (from S3)
$ ccm create nightly_cluster --scylla -n 3 -v unstable/master:2024-12-20T10:30:00Z -s
# Or use the latest nightly build number
$ ccm create nightly_cluster --scylla -n 3 -v unstable/master:380 -s# 3 nodes in dc1, 4 nodes in dc2, 5 nodes in dc3
$ ccm create my_multi_dc_cluster --scylla -n 3:4:5 -v release:2024.2 -sScylla CCM primarily uses relocatable packages downloaded from S3. These are pre-built packages that work across different Linux distributions.
CCM supports two main version formats:
-
Release versions:
release:X.Y.Zccm create my_cluster --scylla -n 3 -v release:2024.2.3 ccm create my_cluster --scylla -n 3 -v release:6.0
-
Unstable/nightly versions:
unstable/<branch>:<timestamp>orunstable/<branch>:<build-number>ccm create my_cluster --scylla -n 3 -v unstable/master:2024-12-20T10:30:00Z ccm create my_cluster --scylla -n 3 -v unstable/master:380 ccm create my_cluster --scylla -n 3 -v unstable/branch-5.4:2024-12-01T10:00:00Z
-
Debug builds: Append
:debugto any versionccm create my_cluster --scylla -n 3 -v release:2024.2:debug ccm create my_cluster --scylla -n 3 -v unstable/master:latest:debug
You can override packages with your own locally-built versions:
# Using a unified package (all-in-one)
ccm create my_cluster -n 3 --scylla \
--version my_custom_scylla \
--scylla-unified-package-uri=/path/to/scylla-unified-package.tar.gz
# Mix and match: use S3 version but override just the core package
ccm create my_cluster -n 3 --scylla \
--version unstable/master:380 \
--scylla-core-package-uri=../scylla/build/release/scylla-package.tar.gz
# Override individual components
ccm create my_cluster -n 3 --scylla --version temp \
--scylla-core-package-uri=../scylla/build/release/scylla-package.tar.gz \
--scylla-tools-java-package-uri=../scylla-tools-java/temp.tar.gz \
--scylla-jmx-package-uri=../scylla-jmx/temp.tar.gzCCM supports running Scylla clusters in Docker containers:
# Create cluster using official Scylla Docker image
ccm create my_docker_cluster --scylla --docker-image scylladb/scylla:6.0 -n 3
ccm start
ccm statusFor more details, see docs/docker-ccm.md.
If you have a locally compiled Scylla installation, you can use it instead of relocatable packages:
# Create cluster from local Scylla installation
ccm create my_local_cluster --scylla -n 3 --install-dir=/path/to/scylla
# Or from the Scylla source directory
cd /path/to/scylla
ccm create my_local_cluster --scylla -n 3- Python 3.9+ (tested with Python 3.14)
- UV - for development and building from source
- Java 8+ - only required for:
- Using Cassandra clusters
- Using older Scylla versions (< 6.0)
- Docker (optional) - for Docker-based clusters
- Multiple loopback interfaces - CCM runs nodes on 127.0.0.X addresses
- On Linux: Usually available by default
- On Mac OS X: Create aliases manually:
sudo ifconfig lo0 alias 127.0.0.2 up sudo ifconfig lo0 alias 127.0.0.3 up # ... add more as needed
By default ccm will look for Java in /usr/lib/jvm directory. If you have a custom Java installation directory,
you can provide CUSTOM_JAVA_HOME env variable. When this environment, ccm will assume Java binary is available
under $CUSTOM_JAVA_HOME/bin/java path.
- This fork of CCM doesn't support Windows
- Docker support is currently experimental
CCM uses UV with setuptools as a build system:
# Install UV if you don't have it
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone and install
git clone https://github.com/scylladb/scylla-ccm.git
cd scylla-ccm
uv sync
# Run CCM directly
./ccm --help
# Or via UV
uv run ccm --helpYou can use CCM through Nix without installing:
# Spawn temporary shell with ccm
nix shell github:scylladb/scylla-ccm
# Install ccm to your profile
nix profile install github:scylladb/scylla-ccm
# Update or remove (find index first)
nix profile list
nix profile upgrade <index>
nix profile remove <index>This project features experimental Nix flake support for reproducible development environments.
- Install Nix: https://nixos.org/download.html
- On Fedora, use "Single-user installation" due to SELinux compatibility
- Enable experimental features:
mkdir -p ~/.config/nix echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf
- For multi-user installations, restart the Nix daemon after this step
Option 1: Using direnv (recommended)
# Install direnv (see: https://direnv.net/docs/installation.html)
cd scylla-ccm
direnv allow .
# Environment loads automatically in project directoryOption 2: Manual activation
nix develop # Launches bash with dev environment
nix develop --command zsh # Use your preferred shellccm create <name> [options] # Create a new cluster
ccm list # List all clusters
ccm switch <name> # Switch to a different cluster
ccm status # Show cluster status
ccm start # Start all nodes
ccm stop # Stop all nodes
ccm remove # Remove current cluster
ccm clear # Clear cluster data but keep configccm node1 start # Start a specific node
ccm node1 stop # Stop a specific node
ccm node1 cqlsh # Connect to node with cqlsh
ccm node1 nodetool status # Run nodetool on a node
ccm node1 showlog # View node logsccm flush # Flush all nodes
ccm compact # Compact all nodes
ccm node1 ring # Show ring information
ccm add node4 -i 127.0.0.4 # Add a new node to clusterFor complete command reference, run ccm --help or ccm <command> --help.
While this fork is optimized for Scylla, CCM still supports Cassandra clusters.
ccm create cassandra_test -v 4.0.0 -n 3 -sccm create cassandra_test --install-dir=/path/to/cassandra -n 3 -s# From Cassandra source directory after compilation
cd /path/to/cassandra
ccm create cassandra_test -n 3 -s# From Apache Git repository
ccm create trunk -v git:trunk -n 3
# From GitHub fork
ccm create patched -v github:jbellis/trunk -n 1# Force source distribution instead of binary
ccm create test -v source:4.0.0 -n 3 -s
# Note: If 'binary:' or 'source:' aren't specified, CCM will
# fallback to building from git if Apache mirrors are unavailableFor Cassandra and older Scylla versions that use JMX, you can enable remote debugging:
# With populate command
ccm populate -d -n 3
# Or when adding individual nodes
ccm add node4 -r 5005 -i 127.0.0.4 -j 7400 -bThis sets up remote debugging on ports 2100, 2200, 2300 for nodes 1, 2, 3 respectively. The main thread will not be suspended, so nodes start without requiring a debugger connection.
By default, CCM stores all node data and configuration files under ~/.ccm/cluster_name/.
For Scylla relocatable packages, downloaded packages are cached in ~/.ccm/scylla-repository/.
You can override the config directory using the --config-dir option with each command.
The CCM facilities are available programmatically through ccmlib for automated testing:
from ccmlib.scylla_cluster import ScyllaCluster
# Create a 3-node Scylla cluster
cluster = ScyllaCluster('.', 'test_cluster', version='release:2024.2')
cluster.populate(3).start()
node1, node2, node3 = cluster.nodelist()
# Run operations
cluster.flush()
node2.compact()
# Connect to nodes via CQL (host and port available at node.network_interfaces['binary'])
# ...
# Cleanup
cluster.stop()
cluster.remove()import ccmlib
# Create a 3-node Cassandra cluster
cluster = ccmlib.Cluster('.', 'test', cassandra_version='4.0.0')
cluster.populate(3).start()
node1, node2, node3 = cluster.nodelist()
# Run operations
cluster.flush()
node2.compact()
# Cleanup
cluster.remove()-- Original Author: Sylvain Lebresne sylvain@datastax.com Scylla Fork Maintained by: ScyllaDB Team