I have a 3-node Cassandra cluster with a keyspace that has a replication factor of 3:
CREATE KEYSPACE demo
WITH REPLICATION = {
'class':'SimpleStrategy',
'replication_factor':3
};
(Deployed in just one data center)
When doing failure testing, ie taking one node down, I'm getting these exceptions when attempting queries against my keyspace:
Caused by: org.apache.cassandra.exceptions.UnavailableException: Cannot achieve consistency level LOCAL_ONE
at org.apache.cassandra.db.ConsistencyLevel.assureSufficientLiveNodes(ConsistencyLevel.java:296) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.service.AbstractReadExecutor.getReadExecutor(AbstractReadExecutor.java:162) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.service.StorageProxy$SinglePartitionReadLifecycle.<init>(StorageProxy.java:1774) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.service.StorageProxy.fetchRows(StorageProxy.java:1736) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.service.StorageProxy.readRegular(StorageProxy.java:1682) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.service.StorageProxy.read(StorageProxy.java:1597) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.db.SinglePartitionReadCommand$Group.execute(SinglePartitionReadCommand.java:997) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:277) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:247) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.auth.CassandraRoleManager.getRoleFromTable(CassandraRoleManager.java:521) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.auth.CassandraRoleManager.getRole(CassandraRoleManager.java:503) ~[apache-cassandra-3.10.jar:3.10]
... 47 common frames omitted
I'm not sure why I'm seeing this error because:
- My replication factor is set to 3 (ie I still have 2 nodes up that each contain all of the data)
- My consistency level is set to QUORUM. (Why am I seeing LOCAL_ONE?)