确定Cassandra中分区的节点

its*_*ata 2 cassandra cql3 cassandra-3.0

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

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

CREATE TABLE example_table (
    id int,    
    content text,
    PRIMARY KEY (id, content)
) 
Run Code Online (Sandbox Code Playgroud)

Hor*_*ria 5

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

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

请查看信息以获取更多信息