From user-return-20400-apmail-cassandra-user-archive=cassandra.apache.org@cassandra.apache.org Thu Sep 1 16:37:09 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 0A2C88341 for ; Thu, 1 Sep 2011 16:37:09 +0000 (UTC) Received: (qmail 4348 invoked by uid 500); 1 Sep 2011 16:37:06 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 4275 invoked by uid 500); 1 Sep 2011 16:37:06 -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 4267 invoked by uid 99); 1 Sep 2011 16:37:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Sep 2011 16:37:06 +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 (athena.apache.org: domain of anthony.ikeda.dev@gmail.com designates 209.85.215.44 as permitted sender) Received: from [209.85.215.44] (HELO mail-ew0-f44.google.com) (209.85.215.44) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Sep 2011 16:37:01 +0000 Received: by ewy19 with SMTP id 19so1193086ewy.31 for ; Thu, 01 Sep 2011 09:36:39 -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=QAQyKeT4gvYRioYLXY5gial+lt4ekwmmEIxuhf+sziA=; b=f53kPbJzT2Ht9VSa39Jiborge99V7MWyqYaCvNEH5FR3OaMeqVrJqav15TCc8osfWw Uh049rwYEslcs5hnyDvzOAKQCpxJQrMnzAj6i4WEnaqsNI6K6U45mAbpRxHnzSDIqgwd SLePKws12DWlzPDdcF0USdIGiXzDvByP1w794= MIME-Version: 1.0 Received: by 10.213.35.211 with SMTP id q19mr151336ebd.24.1314894997934; Thu, 01 Sep 2011 09:36:37 -0700 (PDT) Received: by 10.213.8.134 with HTTP; Thu, 1 Sep 2011 09:36:37 -0700 (PDT) In-Reply-To: References: Date: Thu, 1 Sep 2011 09:36:37 -0700 Message-ID: Subject: Re: Trying to understand QUORUM and Strategies From: Anthony Ikeda To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=000e0cd1d43c44d38b04abe3d9fa --000e0cd1d43c44d38b04abe3d9fa Content-Type: text/plain; charset=ISO-8859-1 Thanks Evneniy, We encountered this exception with the following settings: Caused by: InvalidRequestException(why:consistency level LOCAL_QUORUM not compatible with replication strategy (org.apache.cassandra.locator .SimpleStrategy)) at org.apache.cassandra.thrift.Cassandra$batch_mutate_result.read(Cassandra.java:19045) at org.apache.cassandra.thrift.Cassandra$Client.recv_batch_mutate(Cassandra.java:1035) at org.apache.cassandra.thrift.Cassandra$Client.batch_mutate(Cassandra.java:1009) at me.prettyprint.cassandra.service.KeyspaceServiceImpl$1.execute(KeyspaceServiceImpl.java:95) at me.prettyprint.cassandra.service.KeyspaceServiceImpl$1.execute(KeyspaceServiceImpl.java:90) at me.prettyprint.cassandra.service.Operation.executeAndSetResult(Operation.java:101) at me.prettyprint.cassandra.connection.HConnectionManager.operateWithFailover(HConnectionManager.java:232) at me.prettyprint.cassandra.service.KeyspaceServiceImpl.operateWithFailover(KeyspaceServiceImpl.java:131) at me.prettyprint.cassandra.service.KeyspaceServiceImpl.batchMutate(KeyspaceServiceImpl.java:102) at me.prettyprint.cassandra.service.KeyspaceServiceImpl.batchMutate(KeyspaceServiceImpl.java:108) at me.prettyprint.cassandra.model.MutatorImpl$3.doInKeyspace(MutatorImpl.java:222) at me.prettyprint.cassandra.model.MutatorImpl$3.doInKeyspace(MutatorImpl.java:219) at me.prettyprint.cassandra.model.KeyspaceOperationCallback.doInKeyspaceAndMeasure(KeyspaceOperationCallback.java:20) at me.prettyprint.cassandra.model.ExecutingKeyspace.doExecute(ExecutingKeyspace.java:85) at me.prettyprint.cassandra.model.MutatorImpl.execute(MutatorImpl.java:219) Which is why I raised this email originally. It is probable that we have not configured the system correctly, I just need to find out what it is I'm missing. Anthony On Wed, Aug 31, 2011 at 2:59 PM, Evgeniy Ryabitskiy < evgeniy.ryabitskiy@wikimart.ru> wrote: > Hi > Actually you can use LOCAL_QUORUM and EACH_QUORUM policy everywhere on > DEV/QA/Prod. > Even it would be better for integration tests to use same Consistency level > as on production. > > For production with multiple DC you usually need to chouse between 2 common > solutions: Geographical Distribution or Disaster Recovery. > See: http://www.datastax.com/docs/0.8/operations/datacenter > > LOCAL_QUORUM and EACH_QUORUM for DEV/QA/Prod by examples: > > create keyspace KeyspaceDEV > with placement_strategy = > 'org.apache.cassandra.locator.NetworkTopologyStrategy' > and strategy_options=[{*datacenter1*:1}]; > > create keyspace KeyspaceQA > with placement_strategy = > 'org.apache.cassandra.locator.NetworkTopologyStrategy' > and strategy_options=[{*datacenter1*:2}]; > > create keyspace KeyspaceProd > with placement_strategy = > 'org.apache.cassandra.locator.NetworkTopologyStrategy' > and strategy_options=[{*datacenter1*:3, datacenter2:3}]; > > > Be careful(!!!), usually default name of DC in new cluster is *datacenter1 > *. But cassandra-cli use default name *DC1*. (some small mismatch/bug > maybe). > > Evgeny. > --000e0cd1d43c44d38b04abe3d9fa Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks Evneniy,

We encountered this exception with the f= ollowing settings:

=A0 =A0=A0<= bean id=3D"consistencyLevelPoli= cy" class=3D"me.prettyprint.cassandra.model.Configurabl= eConsistencyLevel">

=A0=A0=A0 =A0 = <property name=3D"defaultRea= dConsistencyLevel" va= lue=3D"LOCAL_QUORUM"/>

=A0=A0=A0 =A0 = <property name=3D"defaultWri= teConsistencyLevel" v= alue=3D"LOCAL_QUORUM"/>

=A0=A0=A0 </bean>


Caused by: InvalidRequestException(why:consistency level LO= CAL_QUORUM not compatible with replication strategy (org.apache.cassandra.l= ocator

.SimpleStrategy))

=A0=A0=A0=A0=A0=A0=A0 at org.apache.cassandra.thrift.Cassan= dra$batch_mutate_result.read(Cassandra.java:19045)

=A0=A0=A0=A0=A0=A0=A0 at org.apache.cassandra.thrift.Cassan= dra$Client.recv_batch_mutate(Cassandra.java:1035)

=A0=A0=A0=A0=A0=A0=A0 at org.apache.cassandra.thrift.Cassan= dra$Client.batch_mutate(Cassandra.java:1009)

=A0=A0=A0=A0=A0=A0=A0 at me.prettyprint.cassandra.service.K= eyspaceServiceImpl$1.execute(KeyspaceServiceImpl.java:95)

=A0=A0=A0=A0=A0=A0=A0 at me.prettyprint.cassandra.service.K= eyspaceServiceImpl$1.execute(KeyspaceServiceImpl.java:90)

=A0=A0=A0=A0=A0=A0=A0 at me.prettyprint.cassandra.service.O= peration.executeAndSetResult(Operation.java:101)

=A0=A0=A0=A0=A0=A0=A0 at me.prettyprint.cassandra.connectio= n.HConnectionManager.operateWithFailover(HConnectionManager.java:232)

=A0=A0=A0=A0=A0=A0=A0 at me.prettyprint.cassandra.service.K= eyspaceServiceImpl.operateWithFailover(KeyspaceServiceImpl.java:131)

=A0=A0=A0=A0=A0=A0=A0 at me.prettyprint.cassandra.service.K= eyspaceServiceImpl.batchMutate(KeyspaceServiceImpl.java:102)

=A0=A0=A0=A0=A0=A0=A0 at me.prettyprint.cassandra.service.K= eyspaceServiceImpl.batchMutate(KeyspaceServiceImpl.java:108)

=A0=A0=A0=A0=A0=A0=A0 at me.prettyprint.cassandra.model.Mut= atorImpl$3.doInKeyspace(MutatorImpl.java:222)

=A0=A0=A0=A0=A0=A0=A0 at me.prettyprint.cassandra.model.Mut= atorImpl$3.doInKeyspace(MutatorImpl.java:219)

=A0=A0=A0=A0=A0=A0=A0 at me.prettyprint.cassandra.model.Key= spaceOperationCallback.doInKeyspaceAndMeasure(KeyspaceOperationCallback.jav= a:20)

=A0=A0=A0=A0=A0=A0=A0 at me.prettyprint.cassandra.model.Exe= cutingKeyspace.doExecute(ExecutingKeyspace.java:85)

=A0=A0=A0=A0=A0=A0=A0 at me.prettyprint.cassandra.model.Mut= atorImpl.execute(MutatorImpl.java:219)


Which is why = I raised this email originally. It is probable that we have not configured = the system correctly, I just need to find out what it is I'm missing.

Anthony

On Wed, Aug= 31, 2011 at 2:59 PM, Evgeniy Ryabitskiy <evgeniy.ryabitskiy@wikimart.ru>= ; wrote:
Hi
Actually you can use LOCAL_QUORUM and= EACH_QUORUM policy everywhere on DEV/QA/Prod.
Even it would be better f= or integration tests to use same Consistency level as on production.

For production with multiple DC you usually need to chouse between 2 co= mmon solutions: Geographical Distribution or Disaster Recovery.
See: http://www.datastax.com/docs/0.8/operations/datacenter <= br>
=A0LOCAL_QUORUM and EACH_QUORUM for DEV/QA/Prod by examples:

= create keyspace KeyspaceDEV
=A0=A0=A0 with placement_strategy =3D 'org.apache.cassandra.locator.Net= workTopologyStrategy'
=A0=A0=A0 and strategy_options=3D[{datacent= er1:1}];

create keyspace KeyspaceQA
=A0=A0=A0 with placement_strategy =3D 'org.apache.cassandra.locator.Net= workTopologyStrategy'
=A0=A0=A0 and strategy_options=3D[{datacenter1:2}];

create ke= yspace KeyspaceProd
=A0=A0=A0 with placement_strategy =3D 'org.apache.cassandra.locator.Net= workTopologyStrategy'
=A0=A0=A0 and strategy_options=3D[{datacenter1:3, datacenter2:3}];

Be careful(!!!), usually default name of DC in new cluster is = datacenter1. But cassandra-cli use default name DC1. (some small= mismatch/bug maybe).

Evgeny.

--000e0cd1d43c44d38b04abe3d9fa--