question

gmldba_107428 avatar image
gmldba_107428 asked Erick Ramirez commented

How can I rebalance vnodes?

I had a cluster with three nodes. The keyspaces have a replication factor of three. I am using vnodes with 8 tokens. Each node owns 100% of data. So far so good. I added a fourth node. I ran a nodetool repair and nodetool cleanup on all the nodes. Now the new node owns 30% of the data another node owns 70% and the other two owns 100% of the data. How can I balance this cluster?

vnodes
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Erick Ramirez avatar image
Erick Ramirez answered Erick Ramirez commented

Virtual nodes with a small number of tokens tend to have a bit of a skew compared to vnodes with num_tokens: 256. When the size of the data is small (say less than 50GB) and there is a large range between the smallest and largest partitions, expect significant discrepancies between nodes. As the node density increases, you should see the delta between nodes to decrease. Cheers!

2 comments Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

gmldba_107428 avatar image gmldba_107428 commented ·

Datastax recommendation is 8 tokens, right? Is there still value in using 256 tokens?

0 Likes 0 ·
Erick Ramirez avatar image Erick Ramirez ♦♦ gmldba_107428 commented ·

You can continue using 256 tokens but be aware of the slight performance hit from the management overhead. Cheers!

0 Likes 0 ·
gmldba_107428 avatar image
gmldba_107428 answered Erick Ramirez commented

Also, I realize that although I have 4 nodes, they are in 3 racks. So Cassandra, divided the data in three racks.

1 comment Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Erick Ramirez avatar image Erick Ramirez ♦♦ commented ·

@gmldba_107428 Just a friendly note that you need to comment instead of "writing an answer" so other users don't confuse this as an answer in the future. Please edit and re-post. Cheers!

0 Likes 0 ·