Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

determine node of a partition in Cassandra

This is maybe a special question but is it possible to determine the node(s) of a partion key?

example: I have a partition key id (int) and I'm using the default Partitioner(Murmur3Partitioner) with 3 nodes and replication factor "1". Can I determine the one node with id = 3?

CREATE TABLE example_table (
    id int,    
    content text,
    PRIMARY KEY (id, content)
) 
like image 417
itstata Avatar asked Jan 28 '26 05:01

itstata


1 Answers

You can use nodetool getendpoints <keyspace> <table> <partition_key>

or you can use select token(<partition_key>) from <table_name> and then run nodetool ring.

Check also this for further info

like image 76
Horia Avatar answered Jan 30 '26 03:01

Horia



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!