Cassandra 3.1 NodeJS driver: cassandra-driver 3.0.0
Keyspace is created using the following statement:
CREATE KEYSPACE IF NOT EXISTS xxxxxx WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 2 };
Even though the replication factor is 2 I am running only one instance for development purpose with consistency level set to ONE. Here is the issue when I try to insert any record with IF NOT EXISTS clause I am getting consistency level error. But statements without IF NOT EXISTS work just fine. Here is the log from cqlsh:
cqlsh:xxxxxx> CONSISTENCY;
Current consistency level is ONE.
cqlsh:xxxxxx> insert into accounts(account_id) values('test');
cqlsh:xxxxxx> insert into accounts(account_id) values('test1') if not exists;
Traceback (most recent call last): File "/usr/bin/cqlsh.py", line 1258, in perform_simple_statement result = future.result() File "/usr/share/cassandra/lib/cassandra-driver-internal-only-3.0.0-6af642d.zip/cassandra-driver-3.0.0-6af642d/cassandra/cluster.py", line 3122, in result raise self._final_exception Unavailable: code=1000 [Unavailable exception] message="Cannot achieve consistency level QUORUM" info={'required_replicas': 2, 'alive_replicas': 1, 'consistency': 'QUORUM'}