Rocherlee
Rocherlee

Reputation: 2791

Cassandra token unequal

I'm using Cassandra 1.2.11

I setup a cluster of 2 nodes using default configurations like below:

num_tokens: 256

endpoint_snitch: SimpleSnitch

initial_token:

When 2 nodes are working, I check nodetool status and find that:

Load Owns HostID Token

56.55 KB 86.8% 2e620ec5-f0cd-4d48-afb4-5738c32e5476 5590003725053436641

42.49 KB 13.2% 704ae042-ce56-4136-99e1-42a5cc12eada 8024527685350563454

Why one node owns 86.8% and another owns 13.2%. I expect they are 50-50. Could you please advise me on this issue?

Thank you

Upvotes: 2

Views: 935

Answers (1)

Richard
Richard

Reputation: 11110

A common cause of this problem is if you start Cassandra with num_tokens=1 (or empty, which is the default in 1.2) and then restart it with num_tokens=256.

If you started Cassandra once, even for a very short time, with this config, then Cassandra will have randomly chosen just one token. Then when restarted with num_tokens=256 it will split the range, but that won't change the distribution.

You can confirm by looking at the logs, or by seeing if the tokens reported by nodetool ring are sequential.

Upvotes: 3

Related Questions