How to change the cluster name in Apache Cassandra

In this article, we will see how to change the cluster name in Apache Cassandra step by step. Default name for Apache Cassnadra cluster is Test Cluster. Changing cluster name is Cassandra cluster level setting.

How to change the cluster name in Apache Cassandra

1. Changing cluster name is Cassandra cluster level setting. So, it is always good practice to take backup of cassandra.yaml file in /etc/cassandra directory.

cd /etc/cassandra/ cp cassandra.yaml cassandra_backup.yaml

How to change the cluster name in Apache Cassandra

2. Now connect to Cassandra using cqlsh and run the below command.

update system.local set cluster_name = 'EMEA' where key='local';

3. Now exit from cqlsh and from Linux terminal run the below command.

nodetool flush -- system

4. Now stop cassandra service.

sudo systemctl stop cassandra

5. Now we have to change the value for setting ‘cluster_name’ in cassandra.yaml file and save the file.

cluster_name: 'EMEA'

6. Then, start the Apache Cassandra on Linux.

sudo systemctl start cassandra

7. Now, connect cassandra using cqlsh. There you can see the new cluster name of Apache Cassandra node.

Video link for the same: