This section covers the steps to upgrade from Cassandra 3 to 4 for Teamwork Cloud 2021x Refresh 2 HF5 and newer releases. If you are trying to upgrade from v19.0, please refer to the data migration guide first.

Before upgrading

  • Make sure that all the nodes are ready.
  • Create a snapshot of your data for backup.
  • Upgrade sstables by running the command nodetool upgradesstables on each node.

To upgrade Cassandra


  1. IMPORTANT! Flush memtables to the disk by executing the following command:

    nodetool drain
  2. Shut down the 3.x node.

  3. Backup the Cassandra configuration file at: /etc/cassandra/default.conf/cassandra.yaml
  4. Make a note of the existing cluster name and token count with the following command:

    grep -E 'num_tokens:|cluster_name:' cassandra.yaml
  5. Uninstall/remove Cassandra 3.x (example with yum package manager)

    sudo yum remove -y cassandra
  6. Install Cassandra 4.x. for installation instructions, see Installing Cassandra on Linux or Installing Cassandra on Windows.
  7. Configure the 4.x node to point to the appropriate data files in the /etc/cassandra/default.conf/cassandra.yaml settings as shown in the example below.

    Example
    data_file_directories:
    - /data/data
    commitlog_directory: /logs/commitlog
    hints_directory: /data/hints
    saved_caches_directory: /data/saved_caches
  8. Check the cluster name and token count in cassandra.yaml. If needed, replace the default values with the values set in 3.x. The example below shows the default values for a Cassandra 4.x installation. 

    Example
    cluster_name: 'Test Cluster'
    num_tokens: 16

    Cassandra 4 Configuration

    The cluster name and token count must match those values set in Cassandra 3.x.

  9. Start the Cassandra 4.x node.
  10. Check the log files for errors.
  11. After the upgrade is complete, perform required post-installation configuration changes. For more information, see Post-installation steps on Linux or Post-installation steps on Windows.