Cluster rebalancing is a process that makes sure each node in a Cassandra cluster is
managing an equal amount of data.
Currently, OpsCenter only supports rebalancing on clusters using the random
partitioner or murmur 3 partitioner. Ordered partitioners are not supported. When
using the random partitioner or murmur 3 partitioner, a rebalance is usually
required only when you have changed the cluster topology in some way, such as adding
or removing nodes or changing the replica placement strategy.
A cluster is considered balanced when each node is responsible for an equal range of
data. This is done by evaluating the partitioner tokens assigned to each node to
make sure that the data ranges each node is responsible for are even. Even though a
cluster is considered balanced, it is still possible that one or more nodes have
more data than the others. This is because the size of the rows is not taken into
account, only the number of rows managed by each node.
Procedure
-
In the Cluster section of OpsCenter, select Ring View,
Physical View or List View.
The dashboard displays the specified view of your cluster.
-
Click the Rebalance Cluster button.
OpsCenter checks if the token ranges are evenly distributed across the
nodes in your cluster.
-
If your cluster is already balanced, then there is nothing for OpsCenter to do.
If the cluster does require rebalancing, OpsCenter performs the following
steps:
- Calculates appropriate token ranges for each node and identify the nodes
that need to move.
- Makes sure that there is the appropriate free space to perform the
rebalancing.
- Moves nodes, one node at a time so as to lessen the impact on the
cluster workloads. A move operation involves changing the partitioner
token assignment for the node, thus changing the range of data that the
node is responsible for. A move will stream data from other nodes.
- After a move is complete on a node, runs cleanup. A cleanup operation
removes rows that the node is no longer responsible for.
-
If you cancel a rebalance operation before all nodes are moved, you can resume
it at a later time by clicking the Rebalance Cluster button again.