cassandra - Saved cluster name Test Cluster != configured name

Cassandra

Cassandra Problem Overview


How am I supposed to bot a new Cassandra node when I get this error?

INFO [SSTableBatchOpen:1] 2014-02-25 01:51:17,132 SSTableReader.java (line 223) Opening /var/lib/cassandra/data/system/local/system-local-jb-5 (5725 bytes)
ERROR [main] 2014-02-25 01:51:17,377 CassandraDaemon.java (line 237) Fatal exception during initialization
org.apache.cassandra.exceptions.ConfigurationException: Saved cluster name Test Cluster != configured name thisisstupid
        at org.apache.cassandra.db.SystemKeyspace.checkHealth(SystemKeyspace.java:542)
        at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:233)
        at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:462)
        at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:552)

Name of cluster in the cassandra.yaml file is:

cluster_name: 'thisisstupid'

How do I resolve?

Cassandra Solutions


Solution 1 - Cassandra

You can rename the cluster without deleting data by updating it's name in the system.local table (but you have to do this for each node...)

cqlsh> UPDATE system.local SET cluster_name = 'test' where key='local';
# flush the sstables to persist the update.
bash $ ./nodetool flush

Finally you need to rename the cluster to the new name in cassandra.yaml (again on each node)

Solution 2 - Cassandra

The above commands with UPDATE SET cluster_name does not work for me. I found the working is to follow the instructions from the DataStax documentation on Initializing a multiple node cluster:

sudo service cassandra stop
sudo rm -rf /var/lib/cassandra/data/system/*
sudo vi /etc/cassandra/cassandra.yaml, setup the proper parameters
sudo service cassandra start
nodetool status

For some good cluster node setups, I found this blog post to be very useful.

Solution 3 - Cassandra

I had same issue with Datastax4.7 enterprise edition. I resolved it with above instructions:

Change the cluster name back to "test Cluster"

start the cluster:

cqlsh> UPDATE system.local SET cluster_name = 'Cassendra Cluster' where key='local';
cqlsh> exit;
$ nodetool flush system

Stop the cluster:

$sudo service dse stop;sudo service datastax-agent stop

Edit the file:

$ sudo vi /etc/dse/cassandra/cassandra.yaml
cluster_name: 'Cassendra Cluster'

Start the cluster:

$sudo service dse start;sudo service datastax-agent start

Check Installation log:

 $ cat /var/log/cassandra/output.log

Solution 4 - Cassandra

For Cassandra 3.0.5, I tired the answer by Lyuben Todorov but it was missing a key part:

bash $ ./nodetool flush

should be:

bash $ ./nodetool flush system

as in here

Solution 5 - Cassandra

For Cassandra 3.7 you should replace the ./nodetool flush with ./nodetool flush system. Otherwise it won't work.

Solution 6 - Cassandra

If cassandra is not running, you can wipe the data folder.

rm -rf /usr/lib/cassandra/data/*

This will clear the system tables which had the wrong cluster name.
When your restart cassandra with the correct cluster name in your cassandra.yaml everything will be regenerated and you should be good.

Solution 7 - Cassandra

For Bitnami certified Cassandra - 3.11.5

Here's the solution that worked for me:

  1. Stop the Cassandra service
sudo /opt/bitnami/ctlscript.sh stop cassandra
  1. Remove the system data
sudo rm -rf /opt/bitnami/cassandra/data/data/system/*
  1. Start the Cassandra Service
sudo /opt/bitnami/ctlscript.sh start cassandra

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionTampaView Question on Stackoverflow
Solution 1 - CassandraLyuben TodorovView Answer on Stackoverflow
Solution 2 - CassandraRyan XView Answer on Stackoverflow
Solution 3 - CassandraK MurthyView Answer on Stackoverflow
Solution 4 - CassandrahammadianView Answer on Stackoverflow
Solution 5 - CassandrahxgView Answer on Stackoverflow
Solution 6 - CassandraNoah EllmanView Answer on Stackoverflow
Solution 7 - CassandraTarang BhalodiaView Answer on Stackoverflow