Rebalancing a Kafka Cluster with the Adaptive Balancer
The AxonOps Kafka Adaptive Balancer rebalances a Kafka cluster in two separate steps. An analysis runs the enabled goals against the cluster model and produces a list of proposals. An execution applies the proposals of an analysis to the cluster as partition reassignments. Nothing moves until an operator executes an analysis; the balancer does not execute a rebalance on its own.
- Cluster model: the balancer's in-memory picture of brokers, partitions, load, and capacity, rebuilt every model refresh interval.
- Analysis: one run of the enabled goals against the cluster model. It produces proposals of three types: replica moves, leader changes, and disk moves.
- Execution: the application of the most recent analysis's proposals, either as a dry run, which moves nothing, or live.
- Maintenance window: a per-broker marker that stops the broker from receiving replicas and, when set to drain, moves every replica off it.
All of these operations are performed from the Adaptive Balancing section of axon-dash. Installing and connecting the balancer is covered in Kafka Adaptive Balancer Setup; the goals and the data behind the cluster model are described in Kafka Adaptive Balancer Goals and Cluster Model.
Availability
Section titled “Availability”| Requirement | Value |
|---|---|
| Cluster type | Apache Kafka clusters only; a single cluster must be selected, not all clusters |
| Feature | kafka_adaptive_balancer enabled for the organisation (see Kafka Adaptive Balancer) |
| Balancer | Running, connected to axon-dash, and with the cluster registered (see Kafka Adaptive Balancer Setup) |
| Location | Adaptive Balancing in the left menu: Overview, Analyses, Executions, Maintenance, Goals |
| Role | Every Adaptive Balancing page requires the Admin or SuperUser role |
| Leader changes | auto.leader.rebalance.enable=true on the brokers, the default in Apache Kafka (see the broker configuration reference), for leader changes to take effect |
Reassignments are submitted through axon-server to an axon-agent on a broker, which calls the Kafka AlterPartitionReassignments Admin API (Kafka Improvement Proposal KIP-455, Apache Kafka 2.4 and later). The balancer never connects to Kafka directly and sets no Kafka replication throttle.
Rebalancing steps
Section titled “Rebalancing steps”A rebalance follows the steps below; each links to the section of this page that describes it in detail.
- Confirm the requirements in Availability.
- Optionally, open a maintenance window to drain a broker.
- Refresh the cluster model if it is stale.
- Set the analysis options and start the analysis.
- Review the analysis, including its summary, warnings, proposals, and rejection summary, then work through the checks before executing.
- Optionally run a dry run, then the live execution, as described in Dry run and live execution, with a throttle where required.
- Monitor the execution, and cancel it if it must stop early.
- Confirm the outcome, and finish an incomplete execution if movements remain.
- Wait one metrics window after the execution before the next analysis; an analysis started earlier carries the execution-lag warning.
Workflow
Section titled “Workflow”The following diagram shows the same cycle with its decision points and loops, from the cluster model to the next analysis.
Only the most recent analysis can be executed, and execution applies its proposals as they were computed. The analysis to execute should therefore be started immediately before the execution, not taken from an earlier session.
Refreshing the cluster model
Section titled “Refreshing the cluster model”An analysis reasons about the cluster model as of its last rebuild, not about the cluster at the moment the analysis runs. The balancer rebuilds the model on a timer, every model refresh interval (default 5 minutes per cluster, set under Settings → Kafka; see Kafka Adaptive Balancer Configuration Reference). It also rebuilds the model in three other cases:
- When a maintenance window is created or cleared.
- When an analysis starts and the model is older than 30 seconds. If that rebuild fails, the analysis runs against the existing model and the balancer log records a warning.
- When an operator selects Force refresh.
Force refresh is on the Overview page, in the Balancer Status card, next to Next scheduled refresh. The rebuild runs in the background and the page reloads its data 1.5 seconds later. On a cluster with many topics the rebuild can take longer than that, because it makes one request to axon-server per topic; reload the page until Last refresh shows the new time.
A forced refresh is not needed before an analysis, because starting an analysis already rebuilds a model older than 30 seconds. It is used to confirm that the balancer can build a model at all, for example after a change to the cluster. When a refresh fails, the Balancer Status card shows Status ERROR and gives the reason in its Error row. The Overview does not show connection errors: when the balancer is unreachable, its fields are empty. The error text for an unreachable balancer appears on the other Adaptive Balancing pages; see Kafka Adaptive Balancer Setup for the messages and their causes.
A fresh model does not mean fresh load figures. Byte rates, CPU, and I/O wait are averaged over the metrics window (default 1 hour), so they describe the last hour of traffic, not the last minute. The cluster model describes which metrics are read and how.
Running an analysis
Section titled “Running an analysis”Analyses are started from Adaptive Balancing → Analyses.
Analysis options
Section titled “Analysis options”Select Options to open the Override Options panel. Every option applies to the next analysis only.
| Option | Default | Effect |
|---|---|---|
| Disk mount | Auto | Selects which filesystem counts as each broker's disk for this analysis. Auto uses the filesystem holding the broker's first log directory, or an inferred filesystem where the agent does not report one. |
| Excluded topics | Empty | Comma-separated topic names whose partitions most goals leave in place. |
| Excluded brokers | Empty | Comma-separated broker IDs to leave untouched: no replica, leadership, or disk move may have one as its source or destination. |
| Skip hard-goal pre-check | Off | Skips the pre-run check for hard-goal violations and makes a hard goal that cannot be satisfied non-fatal. |
| Allow single-replica moves | Off | Allows partitions with a replication factor of 1 to be moved for routine balancing. |
| Disable leadership moves | Off | Stops the analysis from proposing leader changes. |
The options have the following consequences.
Disk mount. Each entry in the list shows the mount point, its size, and the number of brokers that report it. A named mount point applies to every broker. When any broker does not report that filesystem, the balancer rejects the analysis with an error of the form broker <id> reports no usable filesystem at "<mount>", so choose a mount point reported by every broker. The chosen mount is not shown on the analysis page afterwards. When the list of mounts cannot be read, the list offers only Auto and shows no error.
Excluded topics. Exclusion is not honoured by every goal. The rack goals, ReplicaCapacityGoal, ReplicaDistributionGoal, the usage distribution goals, and TopicReplicaDistributionGoal leave excluded topics alone. The four capacity goals (DiskCapacityGoal, NetworkInboundCapacityGoal, NetworkOutboundCapacityGoal, CpuCapacityGoal), DrainGoal, and LeaderReplicaDistributionGoal do not check the list, and may still propose moving replicas or leadership of an excluded topic. Review the proposals for excluded topics before executing.
Excluded brokers. An excluded broker is frozen for the analysis: nothing moves to or from it. Each rejected action appears in the Rejection Summary with the rejector <excluded-broker> and the verdict BROKER_FROZEN. Frozen brokers affect the goals as follows:
- RackAwareGoal, RackAwareDistributionGoal, ReplicaCapacityGoal, and IntraBrokerDiskCapacityGoal skip any violation that only a move off a frozen broker could fix, so they do not fail the analysis because of it.
- CpuCapacityGoal, DiskCapacityGoal, NetworkInboundCapacityGoal, and NetworkOutboundCapacityGoal do not skip frozen brokers. A frozen broker above a capacity threshold stays above it, the moves that would relieve it appear as
BROKER_FROZENrejections, and the analysis does not fail for that reason. The goal appears under Violated goals (after) only through the pre-run check, because it was violated before the run; with Skip hard-goal pre-check on, it is not listed.
A frozen broker's replicas stay where they are even when the broker is dead. Excluding a dead broker therefore leaves its partitions under-replicated instead of re-placing their replicas on live brokers.
Exclusion is stricter than a maintenance window, which only stops a broker from receiving replicas and, with Drain on, empties it. A broker that is both excluded and in a drain window is not drained. Entries that are not numbers are dropped without a warning; Options Used on the analysis page shows the broker IDs that were applied.
Skip hard-goal pre-check. A hard goal that fails is recorded under Violated goals (after) and skipped for the rest of the run. A skipped goal no longer protects the property it enforces: with RackAwareGoal skipped, proposals may place replicas of one partition on the same rack; with a capacity goal skipped, proposals may take a broker past its capacity threshold. Where the only failing goal is RackAwareGoal on a cluster with fewer racks than its largest replication factor, enabling RackAwareDistributionGoal instead is the safer choice; see Rack awareness.
Allow single-replica moves. By default, a partition with a replication factor of 1 is moved only when its broker is being drained or is dead. Under KIP-455, Kafka adds the new replica and lets it catch up before it removes the old one. Removing the old replica makes Kafka elect the new one as leader, and because the partition has no other replica, it is briefly unavailable during that leader change. A move off a dead broker generally cannot complete; see Failure semantics. On a cluster where most partitions have a replication factor of 1, this default is a common reason for an analysis producing no proposals.
Disable leadership moves. After a leader change, clients that send requests to the old leader receive a NOT_LEADER_OR_FOLLOWER error and then refresh their metadata, and some clients handle that poorly. With this option on, deliberate leader changes are rejected and counted in the Rejection Summary. Moving a replica that is currently a partition's leader still causes a leader change, because Kafka elects a new leader when the leader's replica leaves the partition.
The options stay set while the page is open, including after the panel is closed with Hide options. Start new analysis always sends the current values, whether the panel is visible or not.
Starting the analysis
Section titled “Starting the analysis”Select Start new analysis. The new analysis appears at the top of the Past Analyses table with status PENDING or RUNNING.
| Status | Meaning |
|---|---|
PENDING | Created and waiting to run |
RUNNING | Goals are running against the cluster model |
COMPLETED | Finished; the proposals are available for review |
FAILED | Did not finish; the Error field on the analysis page gives the reason |
The Analyses page does not refresh on its own. Reload the page, re-sort, or change page to see a running analysis reach COMPLETED. An analysis cannot be cancelled once started.
A start error appears in a red box above the table. Two errors are specific to starting an analysis:
cluster model not ready: waiting for initial refresh to populate brokers: the balancer has not yet built a model for the cluster, typically just after it starts. Wait for the first refresh and retry.broker <id> reports no usable filesystem at "<mount>": the Disk mount chosen is missing on at least one broker.
An analysis that fails with a hard-goal error, such as too few racks for RackAwareGoal or insufficient capacity for a capacity goal, reaches FAILED with the goal's message in Error. When an analysis fails lists these errors and their remedies.
Reviewing an analysis
Section titled “Reviewing an analysis”Select a row in Past Analyses to open the analysis page. The review should establish what the plan moves, why, and whether the data behind it is current.

Summary
Section titled “Summary”| Field | Content |
|---|---|
| Status | The analysis status |
| Error | The failure reason; shown for FAILED analyses only |
| Started, Ended | When the analysis ran |
| Model refreshed | When the cluster model behind the analysis was last rebuilt. The proposals reflect broker load and partition sizes as of this time. |
| Proposals | The number of replica move proposals |
| Leader changes | The number of leader change proposals |
| Data to move | The total partition data the replica moves copy, in binary units (KiB, MiB, GiB) |
| Violated goals (after) | Hard goals that were violated in the model before the analysis ran (unless Skip hard-goal pre-check was on), and any goal that failed during the run |
A goal listed under Violated goals (after) because it was violated before the run may be resolved by the proposals; the field does not distinguish that case from a goal that failed. The per-goal outcome is visible only through this field and the Rejection Summary; the page shows no before-and-after score per goal.
Options used
Section titled “Options used”The Options Used section is collapsed when the page opens; select its header to expand it. It shows the options the analysis ran with: Excluded brokers and Excluded topics (as raw JSON, for example null or [1,2]), Skip hard-goal check, Allow single-replica moves, and Disable leadership moves. The Disk mount is not shown.
Warnings
Section titled “Warnings”Two warnings can appear on the analysis page.
- The execution-lag warning is shown when the analysis ran less than one metrics window after the last execution on the cluster finished. Partition placement and disk usage in the model are current, but network, CPU, and disk I/O are still averaged over a window that mostly predates the execution, so a broker the execution relieved can still appear loaded. Load-based proposals in such an analysis may move load that has already moved. A dry run counts as an execution for this warning.
- The single-replica warning is shown when a replica move relocates a partition whose new replica set has one broker. The warning lists the affected partitions (the first 10, then a count) and states that each is briefly unavailable during the move.
Proposals
Section titled “Proposals”The Proposals card has two tabs.
Flow (the default) draws the brokers on a circle, numbered clockwise from the top in broker ID order, with an arc for each path that partitions move along. Blue arcs are replica moves and orange arcs are leadership moves; arc width and the number badge give the partition count on that path. Show switches between Brokers and Racks when the cluster has two or more racks. The fill control (Broker fill or Rack fill) colours each ring by Plan churn, Disk used, Disk I/O wait, Disk I/O rate, Net in rate, Net out rate, or CPU. The fill shows load at analysis time, not a projection after the plan. Selecting a broker isolates the moves to and from it; show all clears the selection. Brokers in a maintenance window or excluded from placement have a dashed ring. Disk moves stay within one broker and are not drawn.

Table lists every proposal with the columns Topic, Partition, Action, From broker, To broker, New replicas, and Data to move. Action shows the proposal type as INTER_BROKER_MOVE (replica move), LEADERSHIP_MOVE (leader change), or INTRA_BROKER_MOVE (disk move). Rows for single-replica partitions carry a warning icon.
Rejection summary
Section titled “Rejection summary”The Rejection Summary counts the actions one goal proposed and another goal rejected, with the columns Proposed by, Rejected by, Verdict, and Count. It explains why a move that looks necessary is missing from the plan: an earlier goal rejected it because the move would have broken that goal's property. How goals work describes the rejection rules.
Some rejections come from analysis rules rather than goals, and show a name in angle brackets under Rejected by:
| Rejected by | Verdict | Cause |
|---|---|---|
<excluded-broker> | BROKER_FROZEN | The move has a broker listed in Excluded brokers as its source or destination |
<excluded-broker> | BROKER_EXCLUDED | The move's destination is a broker in a maintenance window or a dead broker |
<leadership-moves-disabled> | LEADERSHIP_DISABLED | The move is a leader change and Disable leadership moves is on |
<sole-replica-guard> | SOLE_REPLICA_BLOCKED | The move relocates the only replica of a partition off a broker that is neither draining nor dead, and Allow single-replica moves is off |
Cluster stats at analysis time
Section titled “Cluster stats at analysis time”The Cluster Stats at Analysis Time card gives the broker, topic, partition, and replica counts, the total data size, and the average replication factor at the time of the analysis.
Checks before executing
Section titled “Checks before executing”Before selecting Execute (live), confirm the following on the analysis page:
- The analysis is the most recent one and was started moments ago. The execute buttons are offered only on the most recent analysis.
- Model refreshed is no more than about 30 seconds before Started. An earlier time means the pre-analysis rebuild failed and the analysis used an older model.
- No execution-lag warning is shown. If it is, wait until one metrics window has passed since the last execution and run a new analysis.
- Violated goals (after) contains nothing unexpected, and the Rejection Summary explains any move that is absent.
- Data to move can be copied within the 2-hour execution limit at the rate the brokers sustain. A larger plan is left partly applied when the limit is reached.
- The single-replica warning is absent, or the brief unavailability of the listed partitions is acceptable.
- Leader changes are wanted, and
auto.leader.rebalance.enableistrueon the brokers; otherwise they take effect only when a preferred leader election is started manually. - The Table tab contains no
INTRA_BROKER_MOVErows. Disk moves are recorded as completed without moving data. - No other execution on the cluster is in state
RUNNING(check the Executions page). - Where brokers were excluded, Options Used lists the intended broker IDs under Excluded brokers. Entries that are not numbers are dropped without a warning, so a mistyped ID leaves that broker unprotected.
Executing an analysis
Section titled “Executing an analysis”The first card on the analysis page holds the execute controls. For the most recent analysis with at least one proposal or leader change, it offers Execute (dry-run), Execute (live), and Throttle. For the most recent analysis with no proposals, it states that there is nothing to execute. An analysis with no proposals is a valid outcome on a cluster that already meets its enabled goals. Where moves were expected, the Rejection Summary and the single-replica default explain the most common causes. For any older analysis, it states that only the most recent analysis can be executed. A newer analysis supersedes the one on screen, whether another operator started it or anomaly detection did.
Dry run and live execution
Section titled “Dry run and live execution”Execute (dry-run) builds the execution plan from the analysis's proposals and validates it, including a check that every target broker is alive in the current cluster model. It submits nothing to Kafka and finishes in state COMPLETED without moving data. Throttle values are ignored for a dry run.
Execute (live) runs the same checks and then submits the reassignments. Both buttons open the new execution's page.
Execute (live) starts immediately
Execute (live) has no confirmation dialog. A single click starts submitting partition reassignments to Kafka. The proposals are applied as they were computed at analysis time; nothing checks at execution time whether the cluster has changed since, other than that the target brokers are alive. Each reassignment sets the partition's full replica list, so executing an analysis that predates other changes to the same partitions reverses those changes. Run a new analysis immediately before executing, and do not start a live execution while another execution on the cluster is RUNNING.
Throttle
Section titled “Throttle”Select Throttle to set limits for a live execution. A blank field uses the balancer's default, which the field shows as its placeholder. The defaults are set in the global_execution section of the balancer configuration file; see Kafka Adaptive Balancer Configuration Reference.
| Field | Default | Meaning |
|---|---|---|
| Max concurrent movements | 5 | The largest number of replica movements in flight across the cluster at once. A movement is in flight from submission until the balancer observes it complete in the cluster topology. |
| Max tasks per broker | 2 | The largest number of movements in flight per broker. A replica move counts against both its source and its destination broker. |
| Max data rate (MB/s) | 50 | Not a bandwidth limit. The value multiplied by the data movement window (60 seconds) gives a budget for the data of all movements in flight at once: 50 MiB/s allows about 2.93 GiB. A movement is started only when the data already in flight plus its own size fits the budget, except that a movement is always started when nothing else is in flight. |
"MB" in the throttle means MiB (1,048,576 bytes). Leader changes carry no data, are not limited by the data budget, and have a separate cluster-wide limit of 100 in flight that cannot be set from axon-dash.
The balancer sets no Kafka replication throttle (leader.replication.throttled.rate, follower.replication.throttled.rate, and the related topic settings, KIP-73, Apache Kafka 0.10.1 and later). Each reassignment therefore replicates as fast as the brokers allow. The throttle fields limit how many reassignments and how much data are in progress at once, not the rate at which data is copied.
Monitoring an execution
Section titled “Monitoring an execution”The execution page refreshes every 5 seconds until the execution reaches COMPLETED, FAILED, or CANCELLED.
Summary
Section titled “Summary”| Field | Content |
|---|---|
| State | PENDING, RUNNING, COMPLETED, FAILED, or CANCELLED |
| Error | The reason the execution could not start or run; shown for FAILED executions only |
| Started, Ended | When the execution ran |
| Completed / Total proposals | Proposals finished out of the total in the plan |
| Failed proposals | Proposals that failed; shown in red when above 0 |
| Cancelled proposals | Proposals not run because of a cancel; shown only when above 0 |
| Active / Pending | Movements in flight, and movements waiting to start |
| Data moved / total | Data copied so far, out of the plan total |
| Current rate | The current data movement rate |
The Options Used section, collapsed when the page opens, shows whether the execution was a dry run and the throttle values that were in effect, including defaults for fields left blank.
Movements
Section titled “Movements”The Movements card has two tabs.
Flow (the default) draws only the movements still to run, so its arcs empty as the execution progresses. Broker rings show live load, re-read on each refresh. When the execution finishes, the centre of the ring shows a summary of the form N movements completed · X failed · Y cancelled; the failed and cancelled counts appear only when they are not zero.
Table lists every movement with the columns Topic / Partition, Action, From → To, State, Started, Ended, Data size, Data moved, and Error. Action shows Replica move, Leader change, or Disk move.
| Movement state | Meaning |
|---|---|
PENDING | Waiting to start, for a free slot, data budget, or earlier phase |
ACTIVE | Submitted to Kafka; the balancer is polling for completion every 10 seconds |
COMPLETED | The partition's replica set, or its preferred leader, matches the target |
FAILED | The movement failed; Error gives the reason |
CANCELLED | Not run because the execution was cancelled |
All replica moves in an execution run before any disk move, and all disk moves before any leader change. A grey note under a state qualifies a successful movement; it is not an error.
Leader changes
Section titled “Leader changes”A leader change is submitted as a reassignment that keeps the partition's replicas and reorders the list so that the target broker is first, which makes it the preferred leader. Kafka moves leadership to the preferred leader only when it runs a preferred leader election. The balancer cannot start one, so it marks a leader change COMPLETED once the target broker is first in the replica list and in the in-sync replica set (ISR), with the note preferred leader set to broker <id> and in-sync; awaiting Kafka's preferred-leader election.
With auto.leader.rebalance.enable=true, the default in Apache Kafka, the controller checks leadership every leader.imbalance.check.interval.seconds (default 300). What the check elects depends on the metadata mode (see the broker configuration reference). ZooKeeper mode exists up to Apache Kafka 3.9; Apache Kafka 4.0 and later run only in KRaft mode.
- A KRaft controller applies no percentage threshold. It elects the preferred leader for every partition whose leader is not the preferred leader, up to a limit per check cycle.
leader.imbalance.per.broker.percentagehas no effect in KRaft mode and was removed in Apache Kafka 4.0 (KAFKA-18743). - A ZooKeeper-mode controller elects preferred leaders for a broker only when the share of that broker's preferred-leader partitions it does not lead exceeds
leader.imbalance.per.broker.percentage(default 10).
A completed leader change therefore waits for the next check, which runs every 5 minutes with the default interval. In ZooKeeper mode it can wait indefinitely, where the broker's imbalance stays at or below the percentage. With auto.leader.rebalance.enable=false, leadership does not move unless an election is started manually. An election for specific partitions or for all partitions can be started with kafka-leader-election.sh (KIP-460, Apache Kafka 2.4 and later):
kafka-leader-election.sh --bootstrap-server <broker-host>:9092 \ --election-type preferred --all-topic-partitionsWith --all-topic-partitions, the election applies to every partition whose current leader is not its preferred leader, including partitions the execution did not touch.
Confirming the outcome
Section titled “Confirming the outcome”An execution succeeded only when all three of the following hold:
- State is
COMPLETED. - Completed / Total proposals shows every proposal completed.
- Failed proposals is 0.
COMPLETED alone does not mean success. An execution whose movements partly failed, or that reached the 2-hour execution limit, also finishes in COMPLETED. A movement still unfinished at the 2-hour limit is not necessarily counted as failed, which is why the completed count must match the total. For failed movements, the Error column of the Movements table gives the reason. FAILED means the execution could not start or run at all, for example because its execution plan could not be built; the reason is in the Error field.
For leader changes, a COMPLETED state confirms the preferred leader only. Confirm the actual leaders after Kafka's election has run, for example with kafka-topics.sh --bootstrap-server <broker-host>:9092 --describe --topic <topic>, which prints Leader, Replicas, and Isr for each partition.
After a live execution, wait one metrics window before running the next analysis, so that the model's rates describe the new layout.
Cancelling an execution
Section titled “Cancelling an execution”Select Cancel on the execution page, then select Confirm in the dialog. The dialog's Cancel button only dismisses the dialog; Confirm cancels the execution. The balancer accepts a cancel only while the execution is RUNNING, and the button is disabled once the execution has finished.
Cancel does not stop reassignments already in Kafka
Cancelling stops the balancer from starting new movements and drops the queued ones. Reassignments already submitted to Kafka continue until Kafka completes them, and the balancer stops tracking them. Nothing is rolled back. After a cancel, the Summary shows Cancelled proposals, and the Movements table shows every movement that had not completed as CANCELLED with the error execution cancelled. That includes movements that were ACTIVE, whose reassignments may still complete in Kafka afterwards.
To confirm that no reassignment is still running after a cancel, list the in-progress reassignments on the cluster, for example with kafka-reassign-partitions.sh --bootstrap-server <broker-host>:9092 --list (Apache Kafka 2.6 and later, KAFKA-8820). See Kafka Partition Reassignment for cancelling a reassignment in Kafka itself, and Finishing an incomplete execution to complete the work the cancelled execution did not start.
Finishing an incomplete execution
Section titled “Finishing an incomplete execution”An execution can end with work left undone: some of its movements failed, it was cancelled, it reached the 2-hour execution limit, or a balancer restart marked it FAILED. Such an execution cannot be resumed. Executing the same analysis again would apply proposals computed before the partial progress, so the remaining work is finished with a new analysis:
- Confirm that no reassignment is still in progress in Kafka, for example with
kafka-reassign-partitions.sh --bootstrap-server <broker-host>:9092 --list(Apache Kafka 2.6 and later). Reassignments submitted before the execution stopped continue until Kafka completes them. Repeat the check until no reassignment is listed. - Wait one metrics window after the last reassignment completes, so that the model's rates describe the current placement.
- On Analyses, select Start new analysis. The new analysis is built from the current placement, including the moves that completed, so its proposals start from where the incomplete execution left the cluster. They need not match the unfinished part of the original plan.
- Review the analysis as described in Checks before executing.
- Execute it, and confirm the outcome as described in Confirming the outcome.
Draining a broker with a maintenance window
Section titled “Draining a broker with a maintenance window”A maintenance window marks a broker for the balancer. It changes nothing on its own: an analysis must be run and executed for any replica to move. Maintenance windows are managed on Adaptive Balancing → Maintenance.
Opening a window
Section titled “Opening a window”Fill in the Open a Window form and select Create window.
| Field | Content |
|---|---|
| Broker | The broker to mark. The list comes from the brokers AxonOps reports for the cluster. |
| Drain | On by default. When on, the analysis moves every replica off the broker. |
| Reason | Optional free text, for example k8s rollout |
| Expires at | Optional. The time at which the window is removed. Default never. |
The Expires at field is read-only and shows never or the time as YYYY-MM-DD HH:mm:ss in the timezone selected in AxonOps. It is set as follows:
- Selecting the field opens a date picker that starts at the current value, or at one hour from now, and allows no time earlier than now.
- Apply sets the time, No expiry clears it, and closing the picker discards the change.
- The × in the field clears a set time.
The window is removed at the first model refresh after the expiry time. Removing a drain window ends the drain: later analyses no longer move replicas off the broker, the broker can again receive replicas, and nothing warns that a drain was in progress. A window opened for a drain should normally have no expiry and be cleared once the drain is complete.
Nothing happens when Create window is selected without a broker. The window appears in the Active Windows table, whose Opened and Expires columns are shown in the timezone selected in AxonOps (an empty value shows as a dash), and the balancer rebuilds the cluster model so that the next analysis sees it. Each broker has at most one window; creating a window for a broker that already has one replaces it.
A window with Drain on and a window with Drain off behave differently:
- Drain on: the broker receives no replicas and no leadership, and DrainGoal proposes moving every replica on it to the least-loaded eligible broker. Moves off a draining broker are not rejected by soft goals, but hard goals still check them, so the capacity and rack goals can still block a move. Partitions with a replication factor of 1 are moved off a draining broker even when Allow single-replica moves is off.
- Drain off: the broker receives no replicas and no leadership, but replicas already on it stay unless another goal moves them.
Running the drain
Section titled “Running the drain”- Open the window as above.
- On Analyses, select Start new analysis.
- Review the analysis. The broker has a dashed ring in the Flow tab, and the plan should move its replicas to other brokers.
- Execute the analysis live and monitor the execution.
- Repeat from step 2 until an analysis proposes no further moves off the broker.
Repetition is needed because an execution stops starting movements after 2 hours; a broker holding more data than can be moved in that time is drained over several analyse-and-execute cycles. The drain is complete when the broker hosts no replicas, which the broker's tooltip in the Flow tab of a new analysis shows as 0 replicas.
Clearing a window
Section titled “Clearing a window”Select Clear on the window's row in Active Windows. The window is removed immediately, without a confirmation dialog, and the model is rebuilt. An error while clearing is not shown on the page; confirm that the row has gone. After a drained broker returns to service, clear its window and run a new analysis to move load back onto it.
With clusters.persist_state enabled (the default), maintenance windows are stored in AxonOps and survive a restart of the balancer. With it disabled, a restart removes every window.
Managing goals
Section titled “Managing goals”The Goals page (Adaptive Balancing → Goals) lists every goal the balancer implements for the selected cluster, in the Execution Order card, with the columns Order, Band (hard or soft), Name, Enabled, and Description.

The Enabled switch turns a goal on or off for the cluster. Each change is saved as soon as it is made; there is no Save button and no confirmation. A failed save shows Failed to save new order: <error>. Goal settings are per cluster and are stored in AxonOps.
Goals run in a fixed built-in order, hard goals first, and the Order column shows that order. The page allows rows to be dragged, but dragging does not change the order in which goals run; the table returns to the built-in order after the save, and only the enabled state of each goal is kept. The default set of enabled goals, the order, and when to enable the goals that are off by default are covered in Kafka Adaptive Balancer Goals and Cluster Model.
Do Not Do This
Problem: Turning off every goal on the Goals page does not stop analyses from proposing moves. When no goal is enabled for a cluster, the balancer enables every goal it implements for the next analysis, including both rack goals and IntraBrokerDiskCapacityGoal.
Symptoms: An analysis produces proposals from goals that were switched off, including rack moves from both rack goals and INTRA_BROKER_MOVE proposals that are never applied.
Instead: Keep at least one goal enabled. To stop rebalancing a cluster, do not start analyses or executions for it.
History
Section titled “History”- Analyses lists analyses 25 per page, newest first. Selecting the Started column header toggles the sort between newest and oldest first. The pager appears only when there is more than one page. The Execution column shows the state of the most recent execution of each analysis; selecting that cell opens the execution, and selecting elsewhere in the row opens the analysis.
- Executions lists every execution for the cluster in one table, sortable by Started, with the columns Execution ID, Started, State, Completed / Total, Failed, Active, Pending, and Data moved / total.
- The balancer keeps the 200 newest analyses per cluster in memory. With
persist_stateenabled (the default), it also stores analyses, executions, anomalies, and maintenance windows in AxonOps and reloads up to 7 days of them, at most 200 records of each kind per cluster, when it starts. axon-server deletes stored history after its events retention period, 1 week by default. History retention gives the full rules. - No per-execution event log is available; the execution page and its Movements table are the record of an execution.
Failure semantics
Section titled “Failure semantics”The execution contract is as follows.
- Execute (live) starts on the click, with no confirmation. The only pre-flight check is that every target broker is alive in the current cluster model; when one is not, the execution is refused with
cannot execute: target broker(s) [<ids>] are not alive in the current cluster model; re-run analysis against the current topology. Nothing else checks whether the analysis still matches the cluster. - An execution whose movements partly failed, or that reached the 2-hour limit, ends in
COMPLETED. A failed movement does not stop the rest of the execution. Success requires Completed / Total proposals to be complete and Failed proposals to be 0. FAILEDmeans the execution did not run: the execution plan could not be built or started, or the cluster could not be found.- A cancel drops the queued movements and starts no new ones. Submitted reassignments continue in Kafka, and nothing is rolled back.
- A running execution cannot resume after the balancer restarts. When the balancer reloads its history, the execution is marked
FAILEDwithinterrupted before completion (balancer restarted); any reassignments already submitted may still be running in Kafka. - An execution stops starting movements after 2 hours; reassignments already submitted keep running. A movement with no observed progress for 5 minutes (
movement_stall_timeout) fails and is not retried; this covers a reassignment Kafka never applied, or one whose new replica is in sync but that does not finalise. A movement still in progress after 30 minutes is resubmitted with the same target replica list. When movements are queued but none can start and nothing is in flight for 2 minutes (dispatch_stall_timeout), the remaining movements fail. - A failed submission to axon-server is retried by the HTTP client on network errors, HTTP 5xx, and HTTP 429 (
axonops.retry_count, default 3, andaxonops.retry_delay, default 1 second), then by the movement up to 3 more times, 5 seconds apart. Other HTTP 4xx responses, apart from 408 and 425, fail the movement without a retry. axon-server returns HTTP 500available kafka nodes not foundwhen no Kafka agent with a live Kafka connection has reported in the last 10 seconds, and HTTP 403 when the balancer's AxonOps credential lacks the Admin role. - When a replica move fails, a later leader change for the same partition in the same execution fails with
dependency task failed. - A partition that is absent from the topology on 3 consecutive polls is treated as complete, with a note that the topic was likely deleted during the execution.
- The balancer does not prevent two executions on the same cluster at once, and its limits apply per execution. Two concurrent executions can double the in-flight load and submit conflicting target replica lists for the same partitions. Start an execution only when no other execution on the cluster is
RUNNING. - Rates in the model lag an execution by up to one metrics window, so an analysis run within one metrics window of an execution can propose moving load that has already moved. The analysis page warns when this applies.
- A leader change completes in the balancer when the target is the preferred leader and in the ISR. Leadership moves only when Kafka runs a preferred leader election, and never when
auto.leader.rebalance.enable=falseand no election is started manually. - A partition with a replication factor of 1 is briefly unavailable at the end of a move whose source broker is alive, when Kafka elects the new replica as leader. A move off a dead broker generally stalls and fails after
movement_stall_timeoutinstead, because the new replica has no leader to copy from; see Under-replicated partitions and dead brokers. INTRA_BROKER_MOVEproposals are recorded asCOMPLETEDwithout moving any data, because AxonOps provides no interface for moving a replica between log directories. They arise only when IntraBrokerDiskCapacityGoal is enabled, which it is not by default.
Related pages
Section titled “Related pages”- Kafka Adaptive Balancer: what the balancer does and how its components connect
- Kafka Adaptive Balancer Setup: installing the balancer, connecting it to axon-dash, and troubleshooting connection errors
- Kafka Adaptive Balancer Goals and Cluster Model: the goals, their thresholds, and the metrics the cluster model uses
- Kafka Adaptive Balancer Configuration Reference: execution defaults, model refresh interval, metrics window, and goal thresholds
- Kafka Partition Reassignment: how Kafka performs the reassignments the balancer submits
- Preferred replica election: the Kafka mechanism that completes leader changes