A handy Apache Cassandra token calculator for online initial token calculation with RandomPartitioner and Murmur3Partitioner
When creating a Cassandra cluster and not using virtual nodes that were introduced in version 1.2 (and are not fully supported by OpsCenter yet), you need to define the token range each individual cluster node is responsible for. If you set up Cassandra Clusters from time to time (like I do), this online calculator can be quite handy for you.
Just enter the amount of nodes you want to have initially and the partitioner (either RandomPartitioner or Murmur3Partitioner which is default in Cassandra 1.2+):
Cassandra Token Calculator
Partitioner | |
---|---|
Number of nodes | |
Result |
Note: This implementation uses the BigInteger JavaScript Library by Silent Matt.
Explanation of token calculation
The token calculation is basically a function that divides the whole token range into equally sized subparts. For the RandomPartitioner, Cassandra offers a tool to calculate the partitions, for Murmur3, a Python script is provided:
Latest posts by Gernot R. Bauer (see all)
- This was Cassandra Meetup in Vienna - 2014-01-20
- Announcement: First Cassandra Meetup Vienna on January 13, 2014 - 2014-01-09
- Cassandra Summit Europe 2013 - 2013-10-26
Everything is very open with a clear clarification of the challenges.
It was definitely informative. Your website is very helpful.
Thank you for sharing!