nodetool getendpoints 功能可参考 https://docs.scylladb.com/stable/operating-scylla/nodetool-commands/getendpoints.html#nodetool-getendpoints
一般用法 nodetool getendpoints <keyspace> <table> <key/token>
,而对于复合分区键,key
使用冒号进行区分,当我们的primary key
是text
类型且包含冒号时,就会被误判为复合分区键从而报错,为了解决这个问题,我们可以先查对应的token
,然后再通过token
查endpoint
,例:
CREATE TABLE test.person (
id text PRIMARY KEY,
name text
)
// 想知道id=123:456对应的数据保存在哪个节点
// 先查token
select token(id) from test.person where id='123:456'
// 再执行nodetool
nodetool getendpoints test person <查询的token值>
网友评论