DataStax Help Center

Node startup fails with error "ConfigurationException: Cannot change the number of tokens"


A DataStax Enterprise node is unable to startup and join the cluster with a ConfigurationException relating to the token assignments.


Node startup fails reporting an error while loading the configuration file cassandra.yaml. Below is a sample exception stack trace from DSE 4.5.8:

 INFO 17:01:33,587 Loading settings from file:/home/automaton/dse-4.5.8/resources/cassandra/conf/cassandra.yaml
ERROR 17:01:33,678 Fatal configuration error
org.apache.cassandra.exceptions.ConfigurationException: Cannot change the number of tokens from 256 to 1
at org.apache.cassandra.service.StorageService.joinTokenRing(
at org.apache.cassandra.service.StorageService.initServer(
at org.apache.cassandra.service.StorageService.initServer(
at org.apache.cassandra.service.CassandraDaemon.setup(
at com.datastax.bdp.server.DseDaemon.setup(
at org.apache.cassandra.service.CassandraDaemon.activate(
at com.datastax.bdp.server.DseDaemon.main(
Cannot change the number of tokens from 256 to 1
Fatal configuration error; unable to start server. See log for stacktrace.


The node was configured incorrectly as a result of human error.

The node was previously configured with vnodes (256 tokens in the example above) but was changed back to single-token and started up with auto_bootstrap: true in cassandra.yaml.

The bootstrap failed when it compared the number of previously saved tokens in the system.local table against the num_tokens: property in cassandra.yaml.


Follow these steps to resolve this issue:

Step 1 - Calculate the token for the node as described in the Generating tokens document.

Step 2 - Reconfigure the token properties in cassandra.yaml:

  • comment out num_tokens
  • set the token assignment initial_token
  • leave auto_bootstrap: true

Step 3 - Delete the following directories. This will ensure that all their contents are cleaned out completely.

  • <data_file_directories>
  • commitlog
  • saved_caches

Step 4 - Recreate the directories above and make sure Cassandra has full permissions.

Step 5 - Bootstrap the node again by starting DSE.

See also

If you have not done so already, recalculate the token assignments. For more information, see Generating tokens.

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request


Powered by Zendesk