You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Anthony Ikeda <an...@gmail.com> on 2011/09/01 18:36:37 UTC
Re: Trying to understand QUORUM and Strategies
Thanks Evneniy,
We encountered this exception with the following settings:
<bean id=*"consistencyLevelPolicy"* class=*
"me.prettyprint.cassandra.model.ConfigurableConsistencyLevel"*>
<property name=*"defaultReadConsistencyLevel"* value=*"LOCAL_QUORUM"*
/>
<property name=*"defaultWriteConsistencyLevel"* value=*"LOCAL_QUORUM"*
/>
</bean>
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.
>
Re: Trying to understand QUORUM and Strategies
Posted by Jonathan Ellis <jb...@gmail.com>.
Note that this is an implementation detail, not something that
inherently can't work with other strategies. LOCAL_QUORUM and
EACH_QUORUM are logically equivalent to QUORUM when there is a single
datacenter.
We tried briefly to add support for non-NTS strategies in
https://issues.apache.org/jira/browse/CASSANDRA-2516, but reverted it
in https://issues.apache.org/jira/browse/CASSANDRA-2627.
On Fri, Sep 2, 2011 at 12:53 PM, Anthony Ikeda
<an...@gmail.com> wrote:
> Okay, great I just wanted to confirm that LOCAL_QUORUM will not work with
> SimpleStrategy. There was somewhat of a debate amongst my devs that said it
> should work.
> Anthon
>
> On Fri, Sep 2, 2011 at 9:55 AM, Evgeniy Ryabitskiy
> <ev...@wikimart.ru> wrote:
>>
>> So.
>> You have created keyspace with SimpleStrategy.
>> If you want to use LOCAL_QUORUM, you should create keyspace (or change
>> existing) with NetworkTopologyStrategy.
>>
>> I have provided CLI examples on how to do it. If you are creating keyspace
>> from Hector, you have to do same via Java API.
>>
>> Evgeny.
>>
>>
>
>
--
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com
Re: Trying to understand QUORUM and Strategies
Posted by Anthony Ikeda <an...@gmail.com>.
Okay, great I just wanted to confirm that LOCAL_QUORUM will not work with
SimpleStrategy. There was somewhat of a debate amongst my devs that said it
should work.
Anthon
On Fri, Sep 2, 2011 at 9:55 AM, Evgeniy Ryabitskiy <
evgeniy.ryabitskiy@wikimart.ru> wrote:
> So.
> You have created keyspace with SimpleStrategy.
> If you want to use *LOCAL_QUORUM, *you should create keyspace (or change
> existing) with NetworkTopologyStrategy.
>
> I have provided CLI examples on how to do it. If you are creating keyspace
> from Hector, you have to do same via Java API.
>
> Evgeny.
>
>
>
Re: Trying to understand QUORUM and Strategies
Posted by Evgeniy Ryabitskiy <ev...@wikimart.ru>.
So.
You have created keyspace with SimpleStrategy.
If you want to use *LOCAL_QUORUM, *you should create keyspace (or change
existing) with NetworkTopologyStrategy.
I have provided CLI examples on how to do it. If you are creating keyspace
from Hector, you have to do same via Java API.
Evgeny.