determine node of a partition in Cassandra

孤者浪人 提交于 2019-12-02 05:27:59

问题


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)
) 

回答1:


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



来源:https://stackoverflow.com/questions/46928762/determine-node-of-a-partition-in-cassandra

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!