patrick
patrick

Reputation: 16949

Cannot change Cassandra datacenter

After cassandra install via sudo apt install -y cassandra, cassandra is running, but I have not yet configured cassandra.yaml and cassandra-topology.properties. Once I configure them cassandra won't start because Cannot start node if snitch's data center (0) differs from previous data center (datacenter1)

Upvotes: 1

Views: 853

Answers (1)

Aaron
Aaron

Reputation: 57748

Assuming that you don't care about the data stored, you can fix that by deleting everything in your data_file_directories. If you're not setting that, you'll find it at $CASSANDRA_HOME/data/data.

Basically, the cluster metadata gets written in the system keyspace, which uses the local replication strategy (system is unique on each node). At start time, Cassandra verifies the stored metadata vs. the config properties being passed. When you change something about the node, Cassandra will throw an error on specific properties like cluster_name, dc, rack (and possibly a few others) when they don't match what's on disk.

tl;dr;

You probably only need to delete only the data for the system keyspace.

But another option, would be to uncomment and set data_file_directories. Then the new node's system metadata would be written there, and the node would start.

Upvotes: 2

Related Questions