Vishal Sharma
Vishal Sharma

Reputation: 1750

Number of tokens attribute in Cassandra YAML

Is there any significance to the value used in the 'number of tokens' attribute in the Cassandra's YAML file if all the nodes have got the same value in their respective YAML files? Is it the relative value that makes the difference? For e.g. is there any difference, whatsoever, in the below 2 scenarios(assume a cluster of n nodes):

Upvotes: 1

Views: 796

Answers (2)

user14090618
user14090618

Reputation: 1

allocate_tokens_for_local_replication_factor is specific to DSE

Apache Cassandra has the parameter allocate_tokens_for_keyspace

Upvotes: 0

Alex Ott
Alex Ott

Reputation: 87244

This value can affect how good data is distributed between nodes - the bigger value is, the more uniform data distribution will be. But this comes at cost of additional overhead because Cassandra will need to maintain all these virtual nodes. Depending on the number of virtual nodes & replication factor, the distribution may vary - for example, for RF=3 & vnodes=8, distribution may vary by ~10%. The recommendation could also different for different versions of Cassandra - for 3.x, recommendation is from 8 to 32. More information you can find in this document.

P.S. If you're using DSE, you may also tweak the allocate_tokens_for_local_replication_factor for better allocation of data.

Upvotes: 3

Related Questions