简体   繁体   中英

Cassandra: Insert fails for consistency level “Quorum”

We get an error "cannot achieve consistency level QUORUM" (details below) in following configuration: Two datacenters with 6 nodes each, all nodes on same rack. It works when CL is set as "Local Quorum".

Basically, as far as we use consistency level that require cross DC consistency, it fails to insert data. "Nodetool status" command shows that all 12 nodes are up and running.

What can be wrong? Your help is much appreciated! Thanks Dimitry

Keyspace

CREATE KEYSPACE test6 WITH replication = {'class': 'NetworkTopologyStrategy', 'C
entralUS': '3', 'EastUs': '3'}  AND durable_writes = true;

Query

INSERT INTO glsitems (itemid,itemkey) VALUES('1', 'LL');

Error

cassandra-driver-2.7.2\cassandra\cluster.py", line 3347, in result
raise self._final_exception
Unavailable: code=1000 [Unavailable exception] message="Cannot achieve     

consistency level QUORUM" info={'required_replicas':   

4, 'alive_replicas':3, 'consistency': 'QUORUM'}

It could be that Cassandra thinks all nodes are in the same datacenter. In this case LOCAL_QUORUM would always work properly but not QUORUM.

Did you correctly configure the snitch ?

Snitch – For multi-data center deployments, it is important to make sure the snitch has complete and accurate information about the network, either by automatic detection (RackInferringSnitch) or details specified in a properties file (PropertyFileSnitch). link

You can find which snitch is used in the cassandra yaml file, property endpoint_snitch .

Here is the datastax documentation about existing snitches with Cassandra 2.0 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM