Skip to content

Latest commit

 

History

History
129 lines (99 loc) · 3.03 KB

step1.md

File metadata and controls

129 lines (99 loc) · 3.03 KB
Consistency ℹ️ For technical support, please contact us via email.
⬅️ Back Step 1 of 3 Next ➡️
Explore the consistency level

✅ Check that all three nodes are up and running:

./node1/bin/nodetool status

✅ Start cqlsh:

./node1/bin/cqlsh

✅ Switch to the killrvideo keyspace:

USE killrvideo;

✅ Use CONSISTENCY to check the current consistency level:

CONSISTENCY;

Verify that the consistency level is set to ONE: only one node must acknowledge a write on a write request, and only one node must return a result set to satisfy a read request.

✅ Set your consistency level to TWO by executing the following command:

CONSISTENCY TWO;

In this cluster setup, consistency level TWO would work the same way as ALL because our current replication settings store one replica per data center, and we have two data centers.

✅ Retrieve the cassandra partition from the videos_by_tag table by executing the following command:

SELECT * FROM videos_by_tag WHERE tag = 'cassandra';

The query should succeed.

✅ Quit cqlsh:

QUIT

✅ Use nodetool getendpoints to determine which nodes hold the replicas for the cassandra partition tag value in the videos_by_tag table:

./node1/bin/nodetool getendpoints killrvideo videos_by_tag 'cassandra'

✅ Use nodetool stopdaemon to bring down the replica node for the cassandra partition in the dc-seattle datacenter:


Note: The dc-seattle datacenter has nodes listening on:

  • 127.0.0.1
  • 127.0.0.2

---
Solution

Make sure that you only shut down one node!

Node (IP) Shutdown command
127.0.0.1
./node1/bin/nodetool stopdaemon
127.0.0.2
./node2/bin/nodetool stopdaemon

Keep track of which node you shut down and also which nodes are still up.


⬅️ Back Next ➡️