Setup information: I have two DataCenters with 5 nodes in each DC.
I understand that each row inserted on to a table is stored based on the data partitioning scheme used; generates the necessary replicas and stores them on other nodes (chooses nodes based on replication strategy) in the cluster. Given a row, is there a way I can find and list all the nodes that contain this row/replica ?
Thanks
Chethan
Check the status of the Cassandra nodes in your cluster - Go to the /<Install_Dir>/apache-cassandra/bin/ directory and type the ./nodetool status command. If the status for all the nodes shows as UN , then the nodes are up and running. If the status for any node shows as DN , then that particular node is down.
If you want to look at the replication factor of a given keyspace, simply execute SELECT * FROM system_schema. keyspaces; and it will print all replication information you need.
The partitioner determines how data is distributed across the nodes in a Cassandra cluster. Basically, a partitioner is a hash function to determine the token value by hashing the partition key of a row's data. Then, this partition key token is used to determine and distribute the row data within the ring.
The composite key consists of a partition key, plus an optional set of clustering columns. The partition key is used to determine the nodes on which rows are stored and can itself consist of multiple columns. The clustering columns are used to control how data is sorted for storage within a partition.
run this on one of the cassandra nodes:
nodetool -h localhost getendpoints <keyspace> <cf> <key>
to print the end points that owns the key
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With