2
votes

I need to add more nodes to our Cassandra cluster but it is unclear to me how to do this properly based on the doc:

http://docs.datastax.com/en/cassandra/2.1/cassandra/operations/ops_add_node_to_cluster_t.html

How do I know if the cluster is using vnodes? We are using it with num_tokens 256 and we only have 3 nodes. I guess if you have that it means we have vnodes.

Is there an easy way to re-shuffle the data?

1

1 Answers

2
votes

Cassandra version 1.2 and higher by default uses vnodes (256 vnodes), which splits a nodes token into multiple sub tokens to make data distribution evenly to all nodes in a balanced manner.

Each vnode will be assigned a token. So you can find how many vnodes assigned in configuration file or using nodetool.

As you have said "num_tokens" tells number of vnodes in that Cassandra node.

(or)

Execute nodetool ring command which will list the tokens in your cluster for each node.

nodetool ring

It is recommended to use vnodes which will balance your cluster. Earlier Cassandra versions lesser than 1.1 does not have vnodes, So we used to generate the tokens and configured in initial_token parameter available in cassandra.yaml file.

Hence in Cassandra versions 1.2 or higher, using of vnodes is enough to balance the cluster, no need for re-shuffle data.