Creating Single-token DSE Clusters
DataStax Mission Control is current in Private Preview. It is subject to the beta agreement executed between you and DataStax. DataStax Mission Control is not intended for production use, has not been certified for production workloads, and might contain bugs and other functional issues. There is no guarantee that DataStax Mission Control will ever become generally available. DataStax Mission Control is provided on an “AS IS” basis, without warranty or indemnity of any kind.
If you are interested in trying out DataStax Mission Control please contact your DataStax account team.
Carefully generating tokens is key to maintaining overall cluster balance, and not a trivial task. Before the advent of DataStax Mission Control, using previous tools or manually allocating a token were the choices for setting a token and ensuring the best cluster balance. Even so, optimal balance is not guaranteed. DataStax Mission Control eases the task of creating single-token clusters.
- Single-token Cassandra clusters
each physical node owns only one token range in the token ring.
- Virtual nodes (vnodes)
each node in the cluster owns two or more token ranges. Vnodes mitigate the challenge of managing unbalanced clusters, where data is not distributed evenly amongst the nodes.
Historically, and by default, tokens are assigned through a Cassandra (C*) allocation algorithm or DSE 6.8’s token-generator tool. In DataStax Mission Control, config maps aid in implementing token-assignments.
Token range recommended limits
|Version||# token ranges|
256 tokens per node
256 tokens per node
16 tokens per node
DataStax Mission Control
This details how to set the
num_tokens: option to
Create a single-token cluster with DataStax Mission Control.
This example works with a single datacenter that has a single-rack cluster with six nodes. The replication factor (RF) is set to DataStax Mission Control’s default of
Modify the DSECluster manifest to explicitly override the default of
16 in the config:cassandraYaml:num_tokens section. From this definition, DataStax Mission Control automatically generates initial tokens.
Required: Modify the DSECluster manifest, explicitly specifying
config:cassandraYaml:num_tokens: 1, as follows:
apiVersion: missioncontrol.datastax.com/v1alpha1 kind: DSECluster metadata: name: dse-cluster spec: serverVersion: 6.8.26 config: cassandraYaml: num_tokens: 1 datacenters: - metadata: name: dc1 size: 6
This change necessarily overrides the default number of tokens (
16) that DSE sets per node.
Do not adjust the
initial_tokenspecification in the DSECluster manifest. You cannot manually vary the configuration option based on the node to which it is applied. Let DataStax Mission Control generate the initial tokens per node for you. See Configure a DSE node.
Issue the following command from a node running DSE and review the resulting cluster:
nodetool -u dse-cluster-superuser -pw <omitted> ring <keyspace-name>
Datacenter: dc1 ========== Address Rack Status State Load Owns Token 6148914691236517204 10.100.3.9 default Up Normal 144.48 KiB 50.00% -9223372036854775808 10.100.6.10 default Up Normal 209.15 KiB 50.00% -6148914691236517206 10.100.1.10 default Up Normal 118.17 KiB 50.00% -3074457345618258603 10.100.0.11 default Up Normal 209.87 KiB 50.00% -1 10.100.2.9 default Up Normal 170.66 KiB 50.00% 3074457345618258602 10.100.5.12 default Up Normal 200.67 KiB 50.00% 6148914691236517204
The result shows a perfectly balanced ring with 6 token ranges of equal size. The
Ownscolumn reveals that each node holds 50% of the data. This is the expected data ownership because every node is replicating 3 token ranges of ⅙ each of the whole ring.
Allowing DataStax Mission Control to assign tokens requires that you do not delete or modify the ConfigMaps that DataStax Mission Control uses to create the required per-node configuration.
If you intend to use custom per-node configurations, then you must manually compute tokens per node. See Configure a DSE node.
Rebalance an existing cluster. Assign tokens to new nodes that are joining an existing cluster.