Cassandra Nodetool/Cqlsh Describe Cluster

I am testing Cassandra on a 3 nodes cluster on Google cloud and trying to see the Ranges Ownership distribution between the nodes ( I have an RF = 3 for the test keyspace). I have tried both CQL describe cluster and Nodetool describecluster but none of them shows as well the ranges (only snitch, partitioner and schema versions). Running cqlsh 5.0.1 | Cassandra 3.9 | CQL spec 3.4.2 . Any idea how can I find this info or why these commands don't display these? Might be because of the cluster setup? Thanks.

2 Answers

From within CQL, you can query the system.local table. This table exists on each node, contains only a single row, and holds data specific to the node itself. The tokens column contains the same data as is returned via the nodetool ring command:

> SELECT tokens FROM system.local ;

 tokens
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 {'-1221474524472000659', '-2679404716758606376', '-9167452864191410895', '-9208108764127114640', '1685199701625160019', '1767371464207122869', '5004977198676178684', '5337137237744686089', '6630117681615088706', '7106607077939671384', '7512974951531203644', '8229478807809310370'}

(1 rows)

Note that querying tokens via system.local returns only the token ranges for the current node. To see them for another node in the cluster, you can query the tokens column on the system.peers table, where they are keyed by IP Address (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)
2

can you try nodetool ring

The token column provides the end of the token range up to and including the value listed.

Read here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest