Suresh Phapale
Suresh Phapale

Reputation: 29

Cassandra key space replication across nodes

I am using Datastax Cassandra. I am creating key space with replication factor 3, so is there any way to determine on which 3 nodes this key space will get replicated?

Upvotes: 0

Views: 72

Answers (1)

chaitan64arun
chaitan64arun

Reputation: 783

I am not sure why you want to do that! But let me try to help.

To calculate this, you will need to know

  • Total no of nodes in the cluster
  • Replication factor
  • Partitioner used
  • No of vnodes

Please calculate the token range using http://docs.datastax.com/en/cassandra/1.2/cassandra/configuration/configGenTokens_c.html

Please calculate the token of your key. CQL has token function. https://docs.datastax.com/en/cql/3.3/cql/cql_using/usePaging.html

Now you can map this number to the range you calculated before to know which physical node it belongs to.

Hope it helps!

Upvotes: 1

Related Questions