Configure Continuous Data Balancing
|
This feature requires an enterprise license. To get a trial license key or extend your trial period, generate a new trial license key. To purchase a license, contact Redpanda Sales. If Redpanda has enterprise features enabled and it cannot find a valid license, restrictions apply. |
Continuous Data Balancing continuously monitors your node and rack availability and disk usage, dynamically balancing partitions to maintain smooth operations and optimal cluster performance.
Continuous Data Balancing also maintains the configured replication level, even after infrastructure failure. Node availability has the highest priority in data balancing. After a rack (with all nodes belonging to it) becomes unavailable, Redpanda moves partition replicas to the remaining nodes. This violates the rack awareness constraint. After the rack (or a replacement rack) becomes available, Redpanda repairs the constraint by moving excess replicas from racks that have more than one replica to the newly-available rack.
After reading this page, you will be able to:
-
Enable Continuous Data Balancing on a Redpanda cluster
-
Check data balancing status using rpk
-
Cancel partition balancing moves for a specific node
Set Continuous Data Balancing properties
To enable Continuous Data Balancing, set the partition_autobalancing_mode property to continuous. Customize the following properties to monitor node availability and disk usage.
| Property | Description |
|---|---|
|
When a node is unreachable for the specified amount of time, Redpanda acts as if the node had been decommissioned: rebalancing begins, re-creating all of its replicas on other nodes in the cluster. |
|
When a node is unavailable for this timeout duration, Redpanda automatically and permanently decommissions the node. This property only applies when |
|
When a node fills up to this disk usage percentage, Redpanda starts moving replicas off the node to other nodes with disk utilization below the percentage. |
For the other partition_autobalancing_mode options, see Cluster balancing.
How the disk usage threshold is calculated
When space management is enabled (the default), Redpanda measures partition_autobalancing_max_disk_usage_percent against the log-storage target, not the raw disk capacity. The log-storage target is the effective local retention capacity: the lower of retention_local_target_capacity_bytes and retention_local_target_capacity_percent applied to the unreserved disk space (the capacity that remains after disk_reservation_percent). Because this target is smaller than the raw disk, a node reaches the threshold at a lower raw-disk utilization than the percentage suggests.
By default, retention_local_target_capacity_bytes is unset, so the percentage target applies. With the default disk_reservation_percent of 25 and retention_local_target_capacity_percent of 80, a node reaches an 80% threshold at approximately 48% of raw disk capacity (0.75 × 0.80 × 0.80). If you set a lower retention_local_target_capacity_bytes, the node reaches the threshold at an even lower raw-disk utilization.
Data that space management can reclaim (data already uploaded to Tiered Storage) counts as free space for this calculation. Redpanda can evict this local data under disk pressure, because object storage already holds a copy.
When a node reaches the threshold, Redpanda chooses which partitions to move first. See how Redpanda prioritizes partitions when disk usage is high.
Use data balancing commands
Use the following rpk commands to monitor and control data balancing.
Check data balancing status
To see the status, run:
rpk cluster partitions balancer-status
This shows the time since the last data balancing, the number of replica movements in progress, the nodes that are unavailable, and the nodes that are over the disk space threshold (default = 80%).
It also returns a data balancing status: off, ready, starting, in-progress, or stalled. If the command reports a stalled status, verify:
-
Are there enough healthy nodes? For example, in a three node cluster, no movements are possible for partitions with three replicas.
-
Does the cluster have sufficient space? Partitions are not moved if all nodes in the cluster are utilizing more than their disk space threshold.
-
Do all partitions have quorum? Partitions are not moved if the majority of its replicas are down.
-
Are any nodes in maintenance mode? Partitions are not moved if a node is in maintenance mode.
Cancel data balancing moves
To cancel the current partition balancing moves, run:
rpk cluster partitions movement-cancel
To cancel partition moves on a specific node, use the --node flag. For example:
rpk cluster partitions movement-cancel --node 1
If continuous balancing is still enabled and the cluster remains unbalanced, Redpanda schedules another partition balancing round. To stop all balancing, first set partition_autobalancing_mode to off, then cancel the current data balancing moves.
|