incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric tamme <eta...@gmail.com>
Subject Re: Docs: Token Selection
Date Thu, 16 Jun 2011 13:21:09 GMT
AJ,

sorry I seemed to miss the original email on this thread.  As Aaron
said, when computing tokens for multiple data centers, you should
compute them independently for each data center - as if it were its
own Cassandra cluster.

You can have "overlapping" token ranges between multiple data centers,
but no two nodes can have the same token, so for subsequent data
centers I just increment the tokens.

For two data centers with two nodes each using RandomPartitioner
calculate the tokens for the first DC normally, but int he second data
center, increment the tokens by one.

In DC 1
node 1 = 0
node 2 = 85070591730234615865843651857942052864

In DC 2
node 1 = 1
node 2 =  85070591730234615865843651857942052865

For RowMutations this will give each data center a local set of nodes
that it can write to for complete coverage of the entire token space.
If you are using NetworkTopologyStrategy for replication, it will give
an offset mirror replication between the two data centers so that your
replicas will not get pinned to a node in the remote DC.  There are
other ways to select the tokens, but the increment method is the
simplest to manage and continue to grow with.

Hope that helps.

-Eric

Mime
View raw message