How do I set the consistency level of an individual CQL query in CQL3?

懵懂的女人 提交于 2019-11-30 06:52:29
Roman Tumaykin

Aaron, the Consistency Level is not needed to be set on the protocol level - for the reasons explained here: https://issues.apache.org/jira/browse/CASSANDRA-4734

Chandan

First set the consistency by running command:

CONSISTENCY QUORUM;

and then then run you query:

SELECT * FROM users WHERE state='TX'

At any point you can check the consistency using:

 CONSISTENCY;

The default consistency level for any query is "ONE". However, one can set the consistency level on query basis as below.

Based on the Replication factor, the location of the partition (nodes list) can be found as below.

nodetool getendpoints Keyspace-name table-name partition-key value

$ nodetool getendpoints stresstest status bill
10.134.38.15
10.134.38.24
10.134.38.26
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!