cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aaron morton <>
Subject Re: get_slice failing if replication factor > running nodes
Date Sat, 13 Aug 2011 03:00:12 GMT
It's pretty easy to fix. For background read this page on the wiki
also have a look at the help in the CLI, just type "help;"

If you want to reduce your RF use an "update keyspace" statement and change the RF down to

You can increase the RF as well, see the wiki page linked above. 

> what's the best practice to handle this kind of thing gracefully in production if we
DID have two nodes and one needs to be taken offline (or crashes).
There is a subtle difference here. The error below is because there is not enough endpoints
in the cluster, either UP or DOWN. If you had 2 nodes and RF 2 and one node went DOWN you
would to get the error. So long as it is known to the cluster, it can stay DOWN.

In that situation you would only be able to operate at CL ONE or ANY, QUORUM and ALL are both
2 when RF is 2. 

I would just start with RF 1 and makes changes as needed. One note, you need RF of at least
3 to be able to work at QUORUM and handle at least 1 node failure. 


Aaron Morton
Freelance Cassandra Developer

On 13 Aug 2011, at 05:33, ian douglas wrote:

> I'm testing a Cassandra 0.8.1 setup with SimpleCassie for PHP, and my get_slice is failing
because when I created the keyspace I set it up like this:
> create keyspace armorgames with strategy_options=[{replication_factor:2}] and placement_strategy
= 'org.apache.cassandra.locator.SimpleStrategy';
> ... in expectation that when this goes into production, we'll have a second node.
> However, in the meantime, I'm just running one node, but now when I run a get_slice,
i get the following error:
> ERROR [pool-2-thread-16] 2011-08-12 10:26:39,797 (line 3041) Internal
error processing get_slice
> java.lang.IllegalStateException: replication factor (2) exceeds number of endpoints (1)
>         at org.apache.cassandra.locator.SimpleStrategy.calculateNaturalEndpoints(
>         at org.apache.cassandra.locator.AbstractReplicationStrategy.getNaturalEndpoints(
>         at org.apache.cassandra.service.StorageService.getLiveNaturalEndpoints(
>         at org.apache.cassandra.service.StorageService.getLiveNaturalEndpoints(
>         at org.apache.cassandra.service.StorageProxy.fetchRows(
>         at
>         at org.apache.cassandra.thrift.CassandraServer.readColumnFamily(
>         at org.apache.cassandra.thrift.CassandraServer.getSlice(
>         at org.apache.cassandra.thrift.CassandraServer.multigetSliceInternal(
>         at org.apache.cassandra.thrift.CassandraServer.get_slice(
>         at org.apache.cassandra.thrift.Cassandra$Processor$get_slice.process(
>         at org.apache.cassandra.thrift.Cassandra$Processor.process(
>         at org.apache.cassandra.thrift.CustomTThreadPoolServer$
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(
>         at java.util.concurrent.ThreadPoolExecutor$
>         at
> So my first question is how can I get around this, secondly, can I 'alter' a keyspace
to change its replication factor on the fly, and what impact does that have, and third, what's
the best practice to handle this kind of thing gracefully in production if we DID have two
nodes and one needs to be taken offline (or crashes).
> Thanks,
> Ian

View raw message