Skip to content

Latest commit

 

History

History
143 lines (114 loc) · 3.22 KB

step1.md

File metadata and controls

143 lines (114 loc) · 3.22 KB
Read Repair ℹ️ For technical support, please contact us via email.
⬅️ Back Step 1 of 2 Next ➡️
Shut down a node an delete it's data files

✅ 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
./node1/bin/nodetool stopdaemon
127.0.0.2
./node2/bin/nodetool stopdaemon
127.0.0.3
./node3/bin/nodetool stopdaemon

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 is ONE 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
⬅️ Back Next ➡️