1

If say RF = 3, in a 5 nodes single data center, then how can I see where exactly my data lands in which node for any keyspace.tablename, and how to prove that data is exactly replicated on 3 nodes.

I have tried various nodetool commands but none give me the exact result or what I am trying to see.

Piyush_Rana
  • 305
  • 3
  • 15

1 Answers1

3

You can prove this using Inserts and queries with various Consistency Levels (CL) from the client side (cqlsh for instance). I'll explain:

  1. Create the Keyspace with RF=3 -> Create the table
  2. INSERT data with CL=ALL (this means all 3 replicas must ACK that the write was successful)
  3. While all nodes are up query (SELECT) for the data using CL=ALL (all 3 replicas must send response for the query to be considered successful)
  4. Stop C* on 1 of the nodes
  5. While 1 node is down (DN state in nodetool status) query (SELECT) for the data using CL=ALL (all 3 replicas must send response for the query to be considered successful).

    a. If the query succeeds, than all 3 replicas are still up and you need to stop another C* node.

    b. If the query fails, set the CL to CL=QUORUM (only 2 out of 3 replicas must send response for the query to be considered successful), and execute the query again.

you can continue this sequence with CL=ONE and even CL=ANY.

You can read more about cqlsh and how to modify the CL here

TomerSan
  • 1,576
  • 6
  • 12