user1261215
user1261215

Reputation:

Cannot change the number of tokens from 1 to 256

I am using Cassandra 2.0 and cluster has been setup with 3 nodes. Nodetool status and ring showing all the three nodes. I have specified tokens for all the nodes.

I followed the below steps to change the configuration in one node:

1) sudo service cassandra stop
2) updated cassandra.yaml (to update thrift_framed_transport_size_in_mb)
3) sudo srevice cassandra start

The specific not started successfully and system.log shows below exception:

org.apache.cassandra.exceptions.ConfigurationException: Cannot change the number of tokens from 1 to 256

What is best mechanism to restart the node without losing the existing data in the node or cluster ?

Upvotes: 2

Views: 6092

Answers (2)

New Contributer
New Contributer

Reputation: 509

I was also getting this error while I was trying to change the number of tokens from 1 to 256. To solve this I tried the following:

Scenario: I have 4 node DSE (4.6.1) cassandra cluster. Let say their FQDNs are: d0.cass.org, d1.cass.org, d2.cass.org, d3.cass.org. Here, the nodes d0.cass.org and d1.cass.org are the seed providers. My aim is to enable nodes by changing the num_token attribute in the cassandra.yaml file.

Procedure to be followed for each node (one at a time):

  • Run nodetool decommission on one node: nodetool decommission
  • Kil the cassandra process on the decommissioned node. Find the process id for dse cassandra using ps ax | grep dse and kill <pid>
  • Once the decommissioning of the node is successful, go to one of the remaining nodes and check the status of the cassandra cluster using nodetool status. The decommissioned node should not appear in the list.
  • Go to one of the active seed_providers and type nodetool rebuild
  • On the decommissioned node, open the cassandra.yaml file and uncomment the num_tokens: 256. Save and close the file. If this node was originally seed provider, make sure that it's ip-address is removed from the seeds: lists from cassandra.yaml file. If this is not done, the stale information about the cluster topology it has will hinder with the new topology which is being provided by the new seed node. On successful start, it can be added again in the seed list.
  • Restart the remaining cluster either using the corresponding option in opscenter or manually stopping cassandra on each node and starting it again.
  • Finally, start cassandra on it using dse cassandra command.

This should work.

Upvotes: 3

RussS
RussS

Reputation: 16576

Switching from Non-Vnodes to Vnodes has been a slightly tricky proposition for C* and the mechanism for previously performing this switch (shuffle) is slightly notorious for instability.

The easiest way forward is to start fresh nodes (in a new datacenter) with vnodes enabled and to transfer data to those nodes via repair.

Upvotes: 3

Related Questions