Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing Cluster Name in Cassandra

I have a cluster with 2 machines (centos7 and cassandra 3.4), 192.168.0.175 and 192.168.0.174. The seed is the 192.168.0.175.

I simply want to change the cluster name. Peace of cake should be.

I did on each cluster :

  • update system.local set cluster_name = 'America2' where key='local';

  • i did the nodetool flush

  • i updated the cassandra.yaml with the new name

  • restarted cassandra.

When i cqlsh any if describes me as connected to new cluster_name America2

When i run nodetool describecluster it shows the old cluster name America

If i stop cassandra on both machines and i try to restart them i find in logs the good old error :

org.apache.cassandra.exceptions.ConfigurationException: Saved cluster name America != configured name America2

So....what am i doing wrong!?

like image 574
Mr'Black Avatar asked Apr 20 '16 08:04

Mr'Black


People also ask

How do I change my cluster name?

In SMIT, select Custom Cluster Configuration > Cluster Nodes and Networks > Initial Cluster Configuration (Custom) > Cluster > Add/Change/Show a Cluster and press Enter. SMIT displays the cluster definition with the current value for the cluster name. Enter the name change.

What is cluster in Cassandra?

A Cassandra cluster is a collection of nodes, or Cassandra instances, visualized as a ring. Cassandra clusters can be defined as “rack aware” or “datacenter aware” so that data replicas could be distributed in a way that could even survive physical outages of underlying infrastructure.

What is the cluster size in Cassandra?

By default, Cassandra uses 7000 for cluster communication (7001 if SSL is enabled), 9042 for native protocol clients, and 7199 for JMX.

How many nodes does Cassandra cluster have?

As we said earlier, each instance of Cassandra has evolved to contain 256 virtual nodes. The Cassandra server runs core processes. For example, processes like spreading replicas around nodes or routing requests.


1 Answers

before changing cluster name

  1. delete node from cluster ring

    nodetool decommission

  2. stop node and change cluster name in cassandra.yaml

  3. clean node

    sudo rm -rf /var/lib/cassandra/* /var/log/cassandra/*

  4. start cassandra node

More information you can find at academy.datastax.com

like image 77
Oleksandr Petrenko Avatar answered Sep 29 '22 13:09

Oleksandr Petrenko