The Cassandra data mode stores data across many nodes and data centers. When operating on data, users choose the consistency level of the operation per requests. The default consistency level used by the CLI is ONE
. This recipe shows how to use the consistencylevel
keyword to change consistency level.
Use the
consistencylevel
statement to change the consistency level:[default@ks33] consistencylevel as QUORUM; Consistency level is set to 'QUORUM'.
After changing the level, do set, get, and list operations as normal:
[default@testkeyspace] get cars2['mynewcar']; => (column=make, value=ford, timestamp=1298580528208000) => (column=weight, value=2000, timestamp=1298580306095000) Returned 2 results.