5

Datastax 手册说我可以使用“USING CONSISTENCY”语法更改一致性级别。 http://www.datastax.com/docs/1.1/references/cql/cql_data_types#specifying-consistency-level

但是,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'

我想念什么?谢谢。

4

1 回答 1

5

WITH CONSISTENCY LEVEL 子句已从 1.2 中的 CQL 命令中删除。现在以编程方式在驱动程序中设置一致性级别。在命令行上,您可以使用新的 cqlsh CONSISTENCY命令

在您的情况下,您已设置为

cqlsh:keyspace> CONSISTENCY ONE;
Consistency level set to ONE.
于 2013-05-16T08:15:22.900 回答