From user-return-17785-apmail-cassandra-user-archive=cassandra.apache.org@cassandra.apache.org Thu Jun 16 13:40:34 2011 Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0F50B6846 for ; Thu, 16 Jun 2011 13:40:34 +0000 (UTC) Received: (qmail 92210 invoked by uid 500); 16 Jun 2011 13:40:31 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 92172 invoked by uid 500); 16 Jun 2011 13:40:31 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 92164 invoked by uid 99); 16 Jun 2011 13:40:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Jun 2011 13:40:31 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [204.13.248.74] (HELO mho-02-ewr.mailhop.org) (204.13.248.74) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Jun 2011 13:40:22 +0000 Received: from 67-6-236-30.hlrn.qwest.net ([67.6.236.30] helo=[192.168.0.2]) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.72) (envelope-from ) id 1QXCnh-000GFH-81 for user@cassandra.apache.org; Thu, 16 Jun 2011 13:40:01 +0000 X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 67.6.236.30 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/mailhop/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19AsRSCNl5dDp8n0IKIovyAPu5n1Q3HiCE= Message-ID: <4DFA07A9.9000204@dude.podzone.net> Date: Thu, 16 Jun 2011 07:39:53 -0600 From: AJ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: user@cassandra.apache.org Subject: Re: Docs: Token Selection References: <4DF7E4E5.90709@dude.podzone.net> <4DF8197F.1040501@dude.podzone.net> <4DF907CF.2060302@dude.podzone.net> <4DF92549.2040208@dude.podzone.net> <4DF96965.3070108@dude.podzone.net> <8A999437-1E50-4EC8-9C22-AE5DC7D1AC2B@thelastpickle.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Thanks Eric! I've finally got it! I feel like I've just been initiated or something by discovering this "secret". I kid! But, I'm thinking about using OldNetworkTopStrat. Do you, or anyone else, know if the same rules for token assignment applies to ONTS? On 6/16/2011 7:21 AM, Eric tamme wrote: > 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 >