✅ Check that all three nodes are up and running:
./node1/bin/nodetool status
✅ 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'
✅ Shut down one of the replica nodes for the cassandra partition by running nodetool stopdaemon
:
Solution
Make sure that you only shut down only one replica node!
Node (IP) | Shutdown command |
---|---|
127.0.0.1 |
|
127.0.0.2 |
|
127.0.0.3 |
|
Keep track of which node you shut down.
✅ Navigate to the data directory of the node you shut down:
(In the command below nodeX is the name of the node you shut down.)
### {"execute": false}
cd ./nodeX/data/data/killrvideo
✅ Use ls
to find the name of the directory for the videos_by_tag table, and then delete the directory:
ls -l
Output
### {"execute": false}
videos_by_tag-d90a364078aa11eabb5ad5e1d0ea70cd
✅ Delete the videos_by_tag... directory:
### {"execute": false}
rm -rf videos_by_tag-d90a364078aa11eabb5ad5e1d0ea70cd
✅ Start cqlsh on one of the running nodes:
✅ Verify that the consistency level is ONE
:
CONSISTENCY;
What do you think will happen when you try to retrieve the cassandra partition from the videos_by_tag table?
Answer
The query should succeed since the consistency level isONE
and there is one active node with the data in the cluster.
✅ Run the query:
SELECT * FROM killrvideo.videos_by_tag WHERE tag = 'cassandra';
✅ Quit cqlsh
QUIT