Database Reference
In-Depth Information
Data-center 3: node1: 0 (duplicate, offset) 2
(final)
node2: 85070591730234615865843651857942052864
(final)
If you draw the ring and re-evaluate the token ownership, you will find
that all the data centers have balanced nodes.
Alternating token assignment : This is a much simpler technique than the previ-
ous one, but it works when all the data centers have an equal number of nodes,
which is a pretty common setup.
In this methodology, we divide the token range by the total number of nodes across all the
clusters. Then we take the first token value, assign it to a node in Data-center 1 , take
a second token and assign it to a node in the second data center, and so on. Keep revolving
through the data centers and assigning the next initial token to nodes until all the nodes
are done (and all the tokens are exhausted).
For a setup with three data centers, with each having two nodes, here are the details:
$ python -c 'print "\n".join([str((2 ** 127)*i/6) for i in
xrange(6) ])'
0 28356863910078205288614550619314017621
56713727820156410577229101238628035242
85070591730234615865843651857942052864
113427455640312821154458202477256070485
141784319550391026443072753096570088106
Data-center1: node1 0
Data-center2: node1 28356863910078205288614550619314017621
Data-center3: node1 56713727820156410577229101238628035242
Data-center1: node2 85070591730234615865843651857942052864
Data-center2: node2 113427455640312821154458202477256070485
Search WWH ::




Custom Search