cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jinhua Luo <luajit...@gmail.com>
Subject Re: does c* 3.0 use one ring for all datacenters?
Date Wed, 11 Apr 2018 13:11:22 GMT
Let me clarify my question:

Given we have a cluster of two DCs, each DC has 2 nodes, each node
sets num_token as 50.
Then how are token ranges distributed in the cluster?

If there is one global ring, then it may be (To simply the case, let's
assume vnodes=1):
{dc1, node1} 1-50
{dc2, node1} 51-100
{dc1, node1} 101-150
{dc1, node2} 151-200

But here comes more questions:
a) what if I add a new datacenter? Then the token ranges need to be re-balanced?
If so, what about the data associated with the ranges to be balanced?
move them among DCs?
But that doesn't make sense, because each keyspace would specify its
snith and fix the DCs to store then.

b) It seems no benefits from same ring, because of the snith.

If each DC has own ring, then it may be:
{dc1, node1} 1-50
{dc1, node1} 51-100
{dc2, node1} 1-50
{dc2, node1} 51-100

I think this is not a trivial question, because each key would be
hashed to determine the token it belongs to, and
the token range distribution in turns determine which node the key belongs to.

Any official answer?


2018-04-11 20:54 GMT+08:00 Jacques-Henri Berthemet
<jacques-henri.berthemet@genesys.com>:
> Maybe I misunderstood something but from what I understand, each DC have the same ring
(0-100 in you example) but it's split differently between nodes in each DC. I think it's the
same principle if using vnode or not.
>
> I think the confusion comes from the fact that the ring range is the same (0-100) but
each DC manages it differently because nodes are different.
>
> --
> Jacques-Henri Berthemet
>
> -----Original Message-----
> From: Jinhua Luo [mailto:luajit.io@gmail.com]
> Sent: Wednesday, April 11, 2018 2:26 PM
> To: user@cassandra.apache.org
> Subject: Re: does c* 3.0 use one ring for all datacenters?
>
> Thanks for your reply. I also think separate rings are more reasonable.
>
> So one ring for one dc is only for c* 1.x or 2.x without vnode?
>
> Check these references:
>
> https://docs.datastax.com/en/archived/cassandra/1.1/docs/initialize/token_generation.html
> http://www.luketillman.com/one-token-ring-to-rule-them-all/
> https://community.apigee.com/articles/13096/cassandra-token-distribution.html
>
> Even the riak official said c* splits the ring across dc:
> http://basho.com/posts/business/riak-vs-cassandra-an-updated-brief-comparison/
>
> Why they said each dc has its own ring?
>
>
> 2018-04-11 19:55 GMT+08:00 Jacques-Henri Berthemet
> <jacques-henri.berthemet@genesys.com>:
>> Hi,
>>
>> Each DC has the whole ring, each DC contains a copy of the same data. When you add
replication to a new DC, all data is copied to the new DC.
>>
>> Within a DC, each range of token is 'owned' by a (primary) node (and replicas if
you have RF > 1). If you add/remove a node in a DC, tokens will be rearranged between all
nodes within the DC only, the other DCs won't be affected.
>>
>> --
>> Jacques-Henri Berthemet
>>
>> -----Original Message-----
>> From: Jinhua Luo [mailto:luajit.io@gmail.com]
>> Sent: Wednesday, April 11, 2018 12:35 PM
>> To: user@cassandra.apache.org
>> Subject: does c* 3.0 use one ring for all datacenters?
>>
>> Hi All,
>>
>> I know it seems a stupid question, but I am really confused about the documents on
the internet related to this topic, especially it seems that it has different answers for
c* with vnodes or not.
>>
>> Let's assume the token range is 1-100 for the whole cluster, how does it distributed
into the datacenters? Think that the number of datacenters is dynamic in a cluster, if there
is only one ring, then the token range would change on each node when I add a new datacenter
into the cluster? Then it would involve data migration? It doesn't make sense.
>>
>> Looking forward to clarification for c* 3.0, thanks!
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
>> For additional commands, e-mail: user-help@cassandra.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
>> For additional commands, e-mail: user-help@cassandra.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
> For additional commands, e-mail: user-help@cassandra.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
For additional commands, e-mail: user-help@cassandra.apache.org


Mime
View raw message