确定Cassandra中分区的节点

时间:2017-10-25 09:28:52

标签: cassandra cql3 cassandra-3.0

这可能是一个特殊问题,但有可能确定分区键的节点吗?

示例:我有一个分区键id(int),我使用默认的Partitioner(Murmur3Partitioner),有3个节点和复制因子" 1"。我可以确定id = 3的一个节点吗?

CREATE TABLE example_table (
    id int,    
    content text,
    PRIMARY KEY (id, content)
) 

1 个答案:

答案 0 :(得分:5)

您可以使用nodetool getendpoints <keyspace> <table> <partition_key>

或者您可以使用select token(<partition_key>) from <table_name>然后运行nodetool ring

另请查看this了解更多信息

相关问题