cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aaron morton <aa...@thelastpickle.com>
Subject Re: how to re-distribute replicas after changing rack assignment
Date Thu, 10 May 2012 11:03:30 GMT
That's a bit tricky. How many nodes, what is the replication and what is the current rack assignment
?

NTS stripes data over the racks in a DC, looping around until the RF is reached. If you change
the rack assignments there is a chance data will be lost. Or at least go missing until a repair
or reap repair puts it in the right place. 

The logic is something like:
1) For each DC get all the nodes. 
2) Order the nodes in the DC by token. 
3) For each node in the DC get the rack, if the rack has not been seen before make the node
a replica. Stop when the RF is reached.
4) If the RF for the DC is not reached, iterate over the sorted nodes in the DC and make them
replicas if they have not been seen before. (Does not check rack again.) 

You should be able to move one node at a time and run repair. Also ensure reads are at QUOURM.


hope that helps. 

-----------------
Aaron Morton
Freelance Developer
@aaronmorton
http://www.thelastpickle.com

On 10/05/2012, at 2:08 AM, Bill Au wrote:

> I am running 1.0.8 with NetworkTopologyStrategy and need to change the rack assignment
of my nodes.  How do I get Cassandra to re-distribute the existing replica according to the
new rack assignment?  Will nodetool repair do the trick?
> 
> Bill


Mime
View raw message