我在Google云上的一个3节点集群上测试Cassandra,并尝试查看节点之间的Ranges所有权分布(测试关键字空间的RF =3)。我尝试过CQL describe cluster和Nodetool describecluster,但它们都没有显示范围(只有snitch、partitioner和schema版本)。运行cqlsh 5.0.1 | Cassandra 3.9 | CQL spec 3.4.2。你知道我怎么才能找到这些信息,或者为什么这些命令不显示这些信息吗?可能是因为集群设置的原因?谢谢。
发布于 2016-12-07 03:13:55
在CQL中,您可以查询system.local表。该表存在于每个节点上,仅包含一行,并保存特定于节点本身的数据。tokens列包含的数据与通过nodetool ring命令返回的数据相同:
> SELECT tokens FROM system.local ;
tokens
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
{'-1221474524472000659', '-2679404716758606376', '-9167452864191410895', '-9208108764127114640', '1685199701625160019', '1767371464207122869', '5004977198676178684', '5337137237744686089', '6630117681615088706', '7106607077939671384', '7512974951531203644', '8229478807809310370'}
(1 rows)请注意,通过system.local查询tokens仅返回当前节点的令牌范围。要查看群集中另一个节点的它们,可以查询system.peers表上的tokens列,其中它们是按IP地址(peer)键入的。
> SELECT tokens FROM system.peers WHERE peer='192.168.6.114';
tokens
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
{'-4094626707569673185', '-5633637686310353556', '-6167080457205238021', '-6475599470116582717', '-6726897113409283403', '-7185540759553541576', '-7282762652579832116', '-7740824590733013501', '-8045274855112430621', '2064433256459654945', '667061811731435593', '7079292008020861651'}
(1 rows)发布于 2016-12-07 01:54:50
你能试试nodetool ring吗?
token列提供了令牌范围的末尾,直到列出的值为止。
点击此处阅读https://docs.datastax.com/en/cassandra/2.1/cassandra/tools/toolsRing.html
https://stackoverflow.com/questions/41001175
复制相似问题