user2597012
user2597012

Reputation: 647

How to change Cassandra number of tokens in a node

I am new at Cassandra, and I believe I setup all the configurations. Now after reading for a while I came across a setup article, and I found a difference between my setup and what was being explained.

Here is a Screenshot my configuration. enter image description here Now my question is, what is Tokens for? and How can I change it to 256?

Thanks a lot in advance!

Upvotes: 1

Views: 4807

Answers (1)

Jim Meyer
Jim Meyer

Reputation: 9475

If you use the virtual nodes features, then you can set the number of tokens to a value like 256, and this will allow Cassandra to automatically load balance your data when nodes are added or removed from a cluster.

There are two fields in cassandra.yaml that control the use of virtual nodes: ".. don’t set the initial_token parameter in your conf/cassandra.yaml and instead enable the num_tokens parameter. A good default value for this is 256." See more information here. You would also generally set partitioner: org.apache.cassandra.dht.Murmur3Partitioner

If you want to change the number of virtual nodes on an existing node, you need to rebuild the data on the node. See this.

Upvotes: 1

Related Questions