> Now if a row key hash is mapped to a range owned by a node in DC3,
> will the Node in DC3 still store the key as determined by the
> partitioner and then walk the ring and store 2 replicas each in DC1
> and DC2 ?
No, only nodes in the DC's specified in the NTS configuration will be replicas.
> Or will the co-ordinator node be aware of the
> replica placement strategy,
> and override the partitioner's decision and walk the ring until it
> first encounters a node in DC1 or DC2 ? and then place the remaining
> replicas ?
The NTS considers each DC to have it's own ring. This can make token selection in a multi
DC environment confusing at times. There is something in the DS docs about it.
Cheers
-----------------
Aaron Morton
Freelance Developer
@aaronmorton
http://www.thelastpickle.com
On 23/05/2012, at 3:16 PM, java jalwa wrote:
> Hi all,
> I am a bit confused regarding the terms "replica" and
> "replication factor". Assume that I am using RandomPartitioner and
> NetworkTopologyStrategy for replica placement.
> From what I understand, with a RandomPartitioner, a row key will
> always be hashed and be stored on the node that owns the range to
> which the key is mapped.
> http://www.datastax.com/docs/1.0/cluster_architecture/replication#networktopologystrategy.
> The example here, talks about having 2 data centers and a replication
> factor of 4 with 2 replicas in each datacenter, so the strategy is
> configured as DC1:2 and DC2:2. Now suppose I add another datacenter
> DC3, and do not change the NetworkTopologyStrategy.
> Now if a row key hash is mapped to a range owned by a node in DC3,
> will the Node in DC3 still store the key as determined by the
> partitioner and then walk the ring and store 2 replicas each in DC1
> and DC2 ? Will that mean that I will then have 5 replicas in the
> cluster and not 4 ? Or will the co-ordinator node be aware of the
> replica placement strategy,
> and override the partitioner's decision and walk the ring until it
> first encounters a node in DC1 or DC2 ? and then place the remaining
> replicas ?
>
> Thanks.
|