Cannot start node if snitch's data center (...) differs from previous data center (...)
Asked Answered
P

3

10

I'm trying to start DSE 5.0.1 Cassandra (single node) on my local.

I'm getting the following 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

Potent answered 15/8, 2016 at 19:14 Comment(0)
R
12

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.

Robber answered 24/8, 2017 at 15:18 Comment(2)
Please don't post identical answers to multiple questions. Post one good answer, then vote/flag to close the other questions as duplicates. If the question is not a duplicate, tailor your answers to the question.Frisk
doesnt work. the cassandra service stops automatically.Boney
B
9

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/

Bedazzle answered 15/8, 2016 at 21:21 Comment(0)
C
1

This issue will happen when you change the datacenter name in the file /etc/dse/cassandra/cassandra-rackdc.properties.

To resolve the issue, please follow these steps:

  1. Clear the following directories (note: if you have data, please take a backup first by using the cp command to copy the files to a backup folder)
    cd /var/lib/cassandra/commitlog
    
    sudo rm -rf *
    
    cd /var/lib/cassandra/data
    
    sudo rm -rf *
    
  2. Now, start the DSE service with the following command:
    service dse start
    
  3. Check the list node's status with this command:
    nodetool -h ::FFFF:127.0.0.1 status 
    
Cahoot answered 26/9, 2022 at 9:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.