Reputation: 3327
I have a 3 node cassandra cluster and on my seed, the num_tokens is set to 256. I'm trying to set it to 1 or comment it out...but every time when i start cassandra, I get this error:
ERROR 21:28:08 Fatal configuration error
org.apache.cassandra.exceptions.ConfigurationException: Cannot change the number of tokens from 256 to 1
I also did a rm -rf /var/lib/cassandra/*
I also tried to go into system.local
in cql and delete everything in the tokens
field but I wasn't able to. How do I change this property?
Upvotes: 1
Views: 4897
Reputation: 4100
Follow these steps to resolve this issue:
Step 1 - Calculate the token for the node (replace all occurences of "number_of_tokens" with valid value):
python -c 'print [str(((2**64 / number_of_tokens) * i) - 2**63) for i in range(number_of_tokens)]'
Step 2 - Reconfigure the token properties in cassandra.yaml:
Step 3 - Delete the following directories. This will ensure that all their contents are cleaned out completely.
Step 4 - Recreate the directories above and make sure Cassandra has full permissions.
Step 5 - Bootstrap the node again by starting DSE.
Upvotes: 2