Consistency
ℹ️ For technical support, please contact us via email.
Use different consistency levels with all nodes available
✅ Start the node you shut down before:
Solution
Make sure that you start the right node!
Node (IP) | Start command |
---|---|
127.0.0.1 |
|
127.0.0.2 |
|
✅ Verify that all three nodes are running:
Solution
./node3/bin/nodetool status
✅ Use cqlsh to set the consistency level to TWO
and retrieve all the rows in the cassandra partition:
Solution
./node1/bin/cqlsh
USE killrvideo;
CONSISTENCY TWO;
SELECT * FROM killrvideo.videos_by_tag WHERE tag = 'cassandra';
The new row should be present.
Note: The row was inserted at consistency level ONE
whn only one replica node was running. This read was at consistency level TWO
and it succeeded. Somehow when the downed node returned to the cluster it synced up and got the new row! Cassandra uses Hinted Handoff to inform nodes about changes that occurred when they were not available. More on this in Exercise 13.