Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot start Cassandra - Snitch's Datacenter Differs from Previous

Im trying to start DSE 5.0.1 Cassandra (Single node) in my local.

Getting below error:

CassandraDaemon.java:698 - Cannot start node if snitch's data center (Cassandra) differs from previous data center (Graph). Please fix the snitch configuration, decommission and rebootstrap this node or use the flag -Dcassandra.ignore_dc=true

like image 573
saysiva Avatar asked Aug 15 '16 19:08

saysiva


2 Answers

This occurs when the node starts and see's that it has information indicating that it was previously part of a different datacenter. This occurs if the datacenter was different on a prior boot and was then changed.

In your case you are most likely using DseSimpleSnitch which names the Datacenter based on the workload of that node. Previously the node was started with Graph enabled which turned the name to Graph. Now trying to start it without Graph enabled leads to it naming the Datacenter Cassandra which is the default.

Using the -Dcassandra.ignore_dc=true flag will allow you to proceed but a better solution would be to switch to GossipingPropertyFileSnitch and give this machine a dedicated datacenter name.

Another option (if you are just testing) is to wipe out the data directory as this will clear out the information previously labeling the datacenter for the node. This will most likely be sudo rm -R /var/lib/cassandra/

like image 117
RussS Avatar answered Sep 21 '22 14:09

RussS


If you are using GossipingPropertyFileSnitch, start Cassandra with the option

-Dcassandra.ignore_dc=true

If it starts successfully, execute:

nodetool repair
nodetool cleanup

Afterwards, Cassandra should be able to start normally without the ignore option.

like image 42
stankov Avatar answered Sep 18 '22 14:09

stankov