确定Cassandra中分区的节点 [英] determine node of a partition in Cassandra

查看:104
本文介绍了确定Cassandra中分区的节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

示例:我有一个分区键ID(整数),并且使用默认的 Partitioner ( Murmur3Partitioner)具有3个节点,复制因子为 1。我可以确定一个id为3的节点吗?

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


推荐答案

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

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

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

还请检查以获取更多信息

Check also this for further info

这篇关于确定Cassandra中分区的节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆