Question

I'm trying to build two 3-node Cassandra clusters in separate data centers. I want to have NetworkToplogyStrategy replication between them, with a replication factor of 3 in each. Thus, I want each node in each data center to have the same records.

Question, what should my token assignment look like for each node? (since i'm not actually partitioning, just replicating).

Thank you!

Était-ce utile?

La solution

If you're using Cassandra 1.2 use virtual nodes with automatic assignment.

If you're using 1.1 or earlier, use for one DC the evenly distributed tokens:

0 56713727820156410577229101238628035242 113427455640312821154458202477256070484

(0, 1 and 2 times 2**127/3)

For the other DC, you can choose anything as long as it is also evenly distributed. Offsetting by 1 works:

1 56713727820156410577229101238628035243 113427455640312821154458202477256070485

Although for now the tokens don't matter since all nodes hold the same data, if you want to scale in the future it will help to have them already balanced.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top