cassandra cqlsh报告使用一致性的错误请求

dy1byipe  于 2021-06-15  发布在  Cassandra
关注(0)|答案(1)|浏览(247)

datastax手册说我可以用“usingconsistency”语法更改一致性级别。http://www.datastax.com/docs/1.1/references/cql/cql_data_types#specifying-一致性级别
但是,cassandra cqlsh报告了使用一致性的错误请求。

cqlsh:db_simple> show version
[cqlsh 2.3.0 | Cassandra 1.2.3 | CQL spec 3.0.0 | Thrift protocol 19.35.0]

cqlsh:db_simple> SELECT * FROM test WHERE a=1;

 a | b  
---+---------
 1 | example

cqlsh:db_simple> SELECT * FROM test USING CONSISTENCY ONE WHERE a=1;
Bad Request: line 1:19 missing EOF at 'USING'

我错过了什么?谢谢。

fhity93d

fhity93d1#

在1.2中,with consistency level子句已从cql命令中删除。通过编程,现在可以在驱动程序中设置一致性级别。在命令行上,可以使用新的cqlsh一致性命令。
在你的情况下,你就像

cqlsh:keyspace> CONSISTENCY ONE;
Consistency level set to ONE.

相关问题