Is there any tool or command to know which nodes holds which token/token ranges?
Bringing together the Apache Cassandra experts from the community and DataStax.
Want to learn? Have a question? Want to share your expertise? You are in the right place!
Not sure where to begin? Getting Started
Is there any tool or command to know which nodes holds which token/token ranges?
HI @firinco,
you can use the nodetool ring
command on any node in your cluster.
In the Token column, you will see the end of the token range up to and including the value listed.
Here an example output from a 3-node cluster (these nodes have single tokens, no vnodes):
# nodetool ring Datacenter: dc1 ========== Address Rack Status State Load Owns Token 8753276737792369966 10.244.2.4 default Up Normal 154.89 KiB 89.45% 3494771406138284716 10.244.3.5 default Up Normal 181.32 KiB 82.05% 5441795363419772543 10.244.1.5 default Up Normal 212.28 KiB 28.51% 8753276737792369966
I hope this helps.
As Bettina already pointed out, the nodetool ring
command will list the tokens assigned to each node.
To add to that, there is also the nodetool describering
command which lists the start and end tokens of the ranges for each keyspace on the nodes. Here is an example output on a single-node cluster I built just to keep it simple:
$ nodetool describering -- community Schema Version:aa056aff-1d08-3072-be83-f3f1ee2a3219 Keyspace: community TokenRange: TokenRange(start_token:3835820215023312942, end_token:3835820215023312942endpoints:[10.101.34.115]rpc_endpoints:[10.101.34.115]endpoint_details:[EndpointDetails(host:10.101.34.115, datacenter:Cassandra, rack:rack1)])
Cheers!
8 People are following this question.
DataStax Enterprise is powered by the best distribution of Apache Cassandra ™
© 2022 DataStax, Titan, and TitanDB are registered trademarks of DataStax, Inc. and its subsidiaries in the United States and/or other countries.
Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries.
Privacy Policy Terms of Use