Skip to content
Piotr Grabowski edited this page May 23, 2022 · 52 revisions

Install

Warning: this tutorial was last updated in 2019. It is in some parts obsolete.

  • Install requirements https://github.com/scylladb/scylla-ccm#requirements
  • Install an appropriate version of the Cassandra Python driver. Currently, too old or too new versions will not work correctly, so install specifically version 3.7.1: To do this, first remove your distribution's version, if any (rpm -e python-cassandra-driver) and then install version 3.7.1 with pip install -I cassandra-driver==3.7.1. The first step (removing your distribution's version) is important, so that when you upgrade your distribution, it doesn't revert you to the wrong version of the package.
  • Download scylla-ccm: git clone https://github.com/scylladb/scylla-ccm.git

Fedora:

sudo dnf install Cython python-psutil python-yaml libev libev-devel patchelf
sudo pip install -I cassandra-driver==3.7.1

Prepare the Scylla Directory

By scylla-dir here we mean the directory holding your clone of the Scylla git repository (git clone https://github.com/scylladb/scylla.git).

  • in the scylla directory build it according to https://github.com/scylladb/scylla#quick-start
  • download scylla-jmx (git clone https://github.com/scylladb/scylla-jmx.git) in parallel to scylla directory, compile it according to the instructions in README.md
  • download scylla-tools-java (git clone https://github.com/scylladb/scylla-tools-java.git) anywhere, and compile it (ant)
  • create a resources directory <scylla-dir>/resources
  • create a soft link from scylla-tools-java diretory into resources ln -s <scylla-tools-java-dir> <scylla-dir>/resources/cassandra
  • To use scylla built using the frozen toolchain (tools/toolchain/dbuild):
    • collect all the required libraries to a directory (for example, see dbuild_collect_so.sh)
    • export SCYLLA_DBUILD_SO_DIR=</absolute/path/to/dynamic_libs> in the environment.

Usage

In the shell you plan to execute scylla-ccm commands, cd to the scylla-ccm directory, and run source scylla_ccm_env.sh. This will set various environment variables (including PATH), so you don't need to stay in that directory later.

Create cluster

ccm create <cluster-name> --scylla --vnodes -n <number of nodes> --install-dir=<scylla-dir>

The install_dir option helps you to choose which scylla binary to use:

  • install_dir - scylla_dir - release version will be used
  • install_dir - scylla_dir/build/release - release version will be used
  • install_dir - scylla_dir/build/debug - debug version will be used

Please note the tool requires scylla-jmx (compiled), it assumes it is parallel to the scylla-dir named scylla-jmx

Note that Scylla's storage for the created cluster will be in a hidden directory in your home directory, $HOME/.ccm/<cluster-name>. In that directory, there is a subdirectory for each node (named node1, node2, etc.). Among other things, the log files are also in that directory - e.g., $HOME/.ccm/<cluster-name>/node1/logs/system.log.

Start cluster

ccm start --no-wait

List clusters

ccm list

Stop+Remove (also removes all the data and logs of this cluster)

ccm remove

To check the cluster status

<scylla-tools-java>/bin/nodetool -p 7100 status

Additional good to know

  1. To add additional command line options use --jvm_arg (you can use more then one)
ccm start --jvm_arg='--default-log-level' --jvm_arg='trace'

this will set the default logging

  1. To create a Cassandra cluster:
ccm create cas-1 --vnodes -n 1 -v 3.10

this creates a cassandra v3.10 cluster with 1 node
Clone this wiki locally