Problem: Changing just the datacenter name in cassandra-rackdc.properties gives the error:
Cannot start node if snitch's data center [newName] differs from previous data center [oldName]. Please fix the snitch configuration, decommission and rebootstrap this node or use the flag -Dcassandra.ignore_dc=true.
Solution:
If you are just beginning to setup you cassandra cluster, and is ok to reset the data to bootstrapped state, do this
sudo service cassandra stop sudo rm -R /var/lib/cassandra sudo mkdir /var/lib/cassandra sudo chown cassandra /var/lib/cassandra sudo service cassandra start
If you need to persist the existing data, do this
sudo vi /etc/cassandra/cassandra-env.sh
# edit the JVM_OPTS line to make it look like below
JVM_OPTS=\"$JVM_OPTS -Dcassandra.ignore_rack=true -Dcassandra.ignore_dc=true\"
sudo service cassandra restart
This should normally resolve the dc name correction in rack-dc properties file.

Sreekumar (KJ) has been a hobby programmer from school days. Codemarvels is his personal blog from the year 2010, where he writes about technology, philosophy, society and a bit about physics.
He now runs a conversational AI company – DheeYantra – focusing his efforts to help businesses improve operational efficiency using digital employees powered by AI.
Leave a Reply