【问题标题】:determine node of a partition in Cassandra在 Cassandra 中确定分区的节点
【发布时间】:2018-04-06 07:51:34
【问题描述】:

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

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

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

【问题讨论】:

    标签: cassandra cql3 cassandra-3.0


    【解决方案1】:

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

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

    查看this了解更多信息

    【讨论】:

      猜你喜欢
      • 2017-05-03
      • 1970-01-01
      • 2017-03-14
      • 2018-03-27
      • 1970-01-01
      • 1970-01-01
      • 2016-02-29
      • 2014-06-10
      • 1970-01-01
      相关资源
      最近更新 更多