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 203797884 for ; Fri, 22 Jul 2011 22:05:18 +0000 (UTC) Received: (qmail 58712 invoked by uid 500); 22 Jul 2011 22:05:16 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 58537 invoked by uid 500); 22 Jul 2011 22:05:15 -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 58529 invoked by uid 99); 22 Jul 2011 22:05:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jul 2011 22:05:15 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of cassandralabs@gmail.com designates 74.125.83.44 as permitted sender) Received: from [74.125.83.44] (HELO mail-gw0-f44.google.com) (74.125.83.44) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jul 2011 22:05:09 +0000 Received: by gwb20 with SMTP id 20so2149600gwb.31 for ; Fri, 22 Jul 2011 15:04:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ngmsnoaDZbIa0w5yjtfTFN9ft8euCt8ELh0AUU1PWuU=; b=ToSSyamNpasMhCmGBULUlZ+WQUBhAvwiPJ3HB7S1nKvLxHOVKbOcL8tLkPPIRJpscy H4egX+7BfaZUs3FJlwH5dGT3CMS7bkOQA00ldmB3aLkR6w/7XmNSK+e767RdkskTewKc 0702TpHZRvoRQdKC47qyohM/W9JfIZ0hlMqYw= MIME-Version: 1.0 Received: by 10.231.91.16 with SMTP id k16mr1787869ibm.124.1311372286685; Fri, 22 Jul 2011 15:04:46 -0700 (PDT) Received: by 10.231.3.83 with HTTP; Fri, 22 Jul 2011 15:04:46 -0700 (PDT) In-Reply-To: References: Date: Fri, 22 Jul 2011 15:04:46 -0700 Message-ID: Subject: Re: question on setup for writes into 2 datacenters From: Sameer Farooqui To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=bcaec5431e0450f05604a8afa7cc X-Virus-Checked: Checked by ClamAV on apache.org --bcaec5431e0450f05604a8afa7cc Content-Type: text/plain; charset=ISO-8859-1 It sounds like what you're looking for is write consistency of local_quorum: http://www.datastax.com/docs/0.8/consistency/index#write-consistency local_quorum would mean the write has to be successful on a majority of nodes in DC1 (so 2) before it is considered successful. If you use just quorum write, it'll have to be committed to 3 replicas out of the 4 before it's considered successful. On Fri, Jul 22, 2011 at 1:57 PM, Dean Hiller wrote: > Ideally, we would want to have a replication factor of 4, and a minimum > write consistency of 2 (which looking at the default in cassandra.yaml is to > memory first with asynch to disk...perfect so far!!!) > > Now, obviously, I can get the partitioner setup to make sure I get 2 > replicas in each data center. The next thing I would want to guarantee > however is that if a write came into datacenter 1, it would write to the two > nodes in datacenter 1 and asynchronously replicate to datacenter 2. Is this > possible? Does cassandra already handle that or is there something I could > do to get cassandra to do that? > > In this mode, I believe I can have both datacenters be live as well as be > backup for the other not wasting resources. > > thanks, > Dean > --bcaec5431e0450f05604a8afa7cc Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable It sounds like what you're looking for is write consistency of local_qu= orum:
http://www.datastax.com/docs/0.8/consistency/index#write-con= sistency

local_quorum would mean the write has to be successful on a majority of= nodes in DC1 (so 2) before it is considered successful.

If you use = just quorum write, it'll have to be committed to 3 replicas out of the = 4 before it's considered successful.




On Fri, Jul 22, 2011 at 1:57 PM,= Dean Hiller <dean= @alvazan.com> wrote:
Ideally, we would want to have a replication factor of 4, and a minimum wri= te consistency of 2 (which looking at the default in cassandra.yaml is to m= emory first with asynch to disk...perfect so far!!!)

Now, obviously,= I can get the partitioner setup to make sure I get 2 replicas in each data= center.=A0 The next thing I would want to guarantee however is that if a w= rite came into datacenter 1, it would write to the two nodes in datacenter = 1 and asynchronously replicate to datacenter 2.=A0 Is this possible?=A0 Doe= s cassandra already handle that or is there something I could do to get cas= sandra to do that?

In this mode, I believe I can have both datacenters be live as well as = be backup for the other not wasting resources.

thanks,
Dean

--bcaec5431e0450f05604a8afa7cc--