Your First Rebalance
This guide walks through generating a rebalancing proposal, reviewing it, and applying it to your cluster.
Prerequisites
- Pilot is running and connected to your Kafka cluster
- You have a valid license for applying proposals
- Your cluster has some partition imbalance (uneven leader or replica distribution)
Step 1: Check Current Balance
Open the Pilot dashboard at http://localhost:8080. The overview page shows Pilot’s balance status and, per broker, stored data, leader and replica counts and the message rate. Proposal review shows the Balance Summary with the broker farthest from its fair share of each load:
- Leaders and followers - partition counts per broker
- Disk - stored bytes per broker
- Producer and consumer rates - messages and bytes per second per broker
You can also check via the API:
curl -s "http://localhost:8080/api/v1/cluster/comprehensive?summary=true" | jq '.data'Step 2: Generate a Proposal
Open Proposal review in the UI to see the latest background proposal. To request a fresh calculation through the API:
curl -X POST http://localhost:8080/api/v1/proposals/generate \
-H "Content-Type: application/json" \
-d '{"immediate": true}' | jq '.'Pilot returns a proposal with:
- Proposal ID - unique identifier
- Expected effect - per load, the broker farthest from its fair share now and after the plan (
fairShare) - Reassignments - list of partition moves with source and destination brokers
- Cost - total movement cost
Step 3: Review the Proposal
Examine the proposed moves carefully:
# Get the full proposal
curl -s http://localhost:8080/api/v1/proposals/{proposalId} | jq '.'Things to check:
- Number of moves - is it reasonable for your cluster size?
- Cross-rack moves - more expensive than same-rack moves
- Balance improvement - how close to its fair share does the plan bring each load’s farthest broker?
- Affected topics - are critical topics being moved?
No proposed moves does not always mean the cluster is balanced. Some imbalances need more partitions, another replication factor or more capacity. Others are too small to be worth moving data. See At Its Limit.
For ordinary balancing, Pilot offers Apply only once it has enough measurements and the plan has stayed worth applying over several measurements. Until then the status reads Collecting measurements, Monitoring or Settling after moves, and there is no Apply action. The generate response reports this in metadata.applicationAllowed, with a message that explains what blocks the apply. See Apply-Time Safety Gating.
Step 4: Apply the Proposal
When the proposal is ready to apply and you have reviewed it, submit it:
curl -X POST http://localhost:8080/api/v1/proposals/{proposalId}/applyPilot will:
- Set replication throttles on the affected brokers
- Submit partition reassignments as broker capacity becomes available
- Monitor progress and clear the throttles when the moves finish
Step 5: Monitor Progress
Open Execution in Pilot. The reassignment monitor shows:
- Active moves - partitions currently being transferred
- Pending moves - queued for execution
- Completed moves - successfully finished
- Failed and cancelled moves - outcomes that require review
The progress percentage counts finished moves, not bytes copied. If you cancel, moves that already finished stay in place.
You can also check via the API:
curl -s http://localhost:8080/api/v1/reassignments | jq '.'Step 6: Verify Balance
After all reassignments complete, check the balance again:
curl -s "http://localhost:8080/api/v1/cluster/comprehensive?summary=true" | jq '.data'Compare the result with the proposal’s projected values and the Balance Summary. Allow the measurements to settle after the moves. A load at its limit can leave a broker more than 10% from its fair share. That does not mean the reassignment failed.
Tips
- Start with a higher threshold - set
PILOT_BALANCE_THRESHOLD=10initially to limit the number of moves - Use conservative throttles - keep
PILOT_THROTTLE_RATE_MBat 50 MB/s for your first rebalance - Exclude internal topics - set
PILOT_EXCLUDE_TOPICS="__consumer_offsets,__transaction_state" - Rebalance during low-traffic periods - less impact on producers and consumers
- Test scenarios first - to test scenarios such as a broker failure before they happen, see the What-If Simulator