Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

gmldba_107428 avatar image
gmldba_107428 asked ·

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 characters needed characters left characters exceeded

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 ·

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 characters needed characters left characters exceeded

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

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

0 Likes 0 · ·

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 ·

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 characters needed characters left characters exceeded

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

@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 · ·