✅ 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 |
|
127.0.0.2 |
|
Keep track of which node you shut down and also which nodes are still up.