On this page
| Table of Contents | ||
|---|---|---|
|
Preparing to upgrade Cassandra
To prepare for Cassandra upgrade
- Ensure that all Cassandra nodes are ready. Run the following command and verify that all nodes are Up and Normal:
Code Block language bash theme DJango linenumbers true nodetool status - Leave the Cassandra service running but stop all Teamwork Cloud services.
- Back up your current database before upgrading.
- Upgrade all Cassandra data tables to current version by running the following command:
Code Block language bash theme DJango linenumbers true nodetool upgradesstablesInfo This process can take a long time for large databases. Use the jobs option to use more threads for the operation (0 for maximum threads available, default is 2). Also, use the nohup command to run the upgrade process in the background.
Code Block language bash theme DJango linenumbers true nohup nodetool upgradesstables --jobs 0 &Make sure this process is completed before proceeding!
Upgrading Cassandra
...
| id | 1262020290 |
|---|
...
| id | 1262020301 |
|---|
...
| id | 1262020300 |
|---|
Teamwork Cloud no longer supports Apache Cassandra 3.x, therefore before upgrading Teamwork Cloud, you need to upgrade Casandra to version 4.1.
...
| title | Before upgrading |
|---|
...
To upgrade Cassandra
IMPORTANT! Flush memtables to the disk by executing the following command:
Code Block language bash theme DJango linenumbers true nodetool drain
...
Shut down the 3.x node.
Stop the Cassandra service.
Make a note of the existing cluster name and token count with the following command:
Code Block language bash theme DJango linenumbers true grep -E 'num_tokens:|cluster_name:' cassandra.yamlUninstall/remove Cassandra
...
(example with yum package manager)
Code Block language bash theme DJango linenumbers true sudo yum remove -y cassandra
...
Info Cassandra configuration files are saved with .rpmsave extension after uninstallation (default path: /etc/cassandra/default.conf
...
| language | bash |
|---|---|
| title | Example |
...
). Archive these files for future reference.
- Install new version of Cassandra (for installation instructions, see Installing Cassandra on Linux).
Check the cluster name and token count
...
in cassandra.yaml. If needed, replace the default values with the values set in
...
the previous version. The example below shows the default values for a Cassandra
...
installation.
...
Code Block language bash title Example cluster_name: 'Test Cluster' num_tokens: 16Note title Cassandra 4 Configuration The cluster name and token count must match those values set in the previous version of Cassandra
...
.
...
- Start the Cassandra
...
- service.
Check if the service is running smoothly:
Check the log
...
file for startup errors.
...
Verify that all nodes have a status of Up and Normal with this command:
Code Block language bash theme DJango linenumbers true nodetool status
- Upgrade all Cassandra data tables to current version by running the following command:
Code Block language bash theme DJango linenumbers true nodetool upgradesstablesInfo This process can take a long time for large databases. Use the jobs option to use more threads for the operation (0 for maximum threads available, default is 2). Also, use the nohup command to run the upgrade process in the background.
Code Block language bash theme DJango linenumbers true nohup nodetool upgradesstables --jobs 0 &Make sure this process is completed before proceeding!
...
Additional resources
For more information about upgrading Apache Cassandra, see https://www.datastax.com/learn/whats-new-for-cassandra-4/migrating-cassandra-4x.