10.3.2 – Broker Failure Recovery Playbooks
Module: M10 – Advanced Topics & Architecture
Section: 10.3 – High Availability & Disaster Recovery
Goal: Operational playbooks for broker failure scenarios
Playbook 1: Single Broker Crash
Detection: Monitoring alerts (broker offline, under-replicated partitions)
Impact: Partitions with leader on failed broker unavailable for writes/reads until failover completes (5-30 seconds)
Recovery Steps:
- Confirm broker is offline (check monitoring, try SSH)
- Wait for automatic leader election (controller handles this)
- Verify no offline partitions:
kafka-topics.sh --describe --under-replicated-partitions - Investigate broker crash (check logs:
/var/log/kafka/server.log) - Fix root cause (OOM, disk full, network issue)
- Restart broker:
systemctl start kafka - Monitor ISR rejoin: Watch
IsrExpandsPerSecmetric - Re-balance leaders (optional):
kafka-leader-election.sh --election-type preferred
RTO: 10-30 minutes (broker restart + ISR sync)
RPO: 0 (no data loss if RF≥2)
Playbook 2: Multiple Broker Failures
Detection: Multiple brokers offline simultaneously
Impact: Some partitions may lose quorum (no ISR members available)
Recovery Steps:
- Immediate: Check if any partitions offline:
kafka-topics.sh --unavailable-partitions - Triage: Prioritize bringing up brokers hosting critical topic partitions
- Recover Brokers: Restart brokers one by one (allow ISR sync between restarts)
- Check ISR: Verify all partitions have min.insync.replicas
- Unclean Election (last resort): If all ISR offline, consider
unclean.leader.election.enable=true(DATA LOSS WARNING)
RTO: 30-60 minutes
RPO: 0 (if ISR maintained), potential data loss if unclean election used
Playbook 3: Disk Failure
Detection: Broker logs show I/O errors, disk full, or RAID failure
Recovery Steps:
- Identify failed disk:
df -h,smartctl -a /dev/sda - Stop broker gracefully:
kafka-server-stop.sh - Replace/repair disk
- Restore partition data:
- Option A: Let broker resync from leaders (automatic, slow)
- Option B: Copy from replica if available (faster)
- Restart broker
- Monitor replication lag until caught up
RTO: 2-8 hours (disk replacement + data sync)
RPO: 0 (replicas on other brokers intact)
Playbook 4: Controller Failure
Detection: Logs show "No controller found", metadata operations slow/failing
Recovery Steps:
- Verify controller offline:
zkCli.sh get /controller(ZK) or check KRaft logs - Wait for new controller election (automatic, <10 seconds)
- Verify new controller: Check
ActiveControllerCount=1metric - If controller not elected (ZK issues):
- Check ZooKeeper quorum health:
echo ruok | nc localhost 2181 - Restart ZooKeeper if quorum lost
- Check ZooKeeper quorum health:
RTO: 10-30 seconds (auto-election)
RPO: 0
Playbook 5: ZooKeeper Quorum Loss
Detection: Kafka brokers log "Unable to connect to ZooKeeper"
Impact: Cluster metadata frozen, no leader elections, cluster effectively down
Recovery Steps:
- Check ZK quorum:
echo ruok | nc localhost 2181on all ZK nodes - Identify issue: Network partition? ZK disk full? Config error?
- Restore quorum:
- If 1 of 3 down: Restart failed ZK node
- If 2 of 3 down: Fix both to restore quorum
- Verify Kafka reconnects: Check broker logs for "Connected to ZooKeeper"
- Trigger metadata refresh:
kafka-metadata.sh --snapshot
RTO: 10-30 minutes
RPO: 0 (no data loss, but writes blocked during outage)
Playbook 6: Network Partition
Detection: Brokers can't reach each other, split brain warnings
Recovery Steps:
- Identify partition:
ping,traceroutebetween brokers - Don't restart brokers (will make situation worse)
- Fix network issue (firewall, switch, routing)
- Wait for network heal
- Brokers auto-reconnect and sync
- Check for under-replicated partitions after heal
RTO: Until network fixed
RPO: 0
Playbook 7: Full Cluster Crash
Detection: All brokers offline
Recovery Steps:
- Start ZooKeeper ensemble first (if using ZK)
- Start brokers one by one (don't start all simultaneously)
- Wait for each broker to become healthy before starting next
- Verify controller election:
ActiveControllerCount=1 - Check all partitions have leaders:
kafka-topics.sh --describe - Resume traffic
RTO: 30-60 minutes
RPO: 0 (data on disk, if not corrupted)
Key Takeaways
- Single Broker: Auto-recovers in 10-30 seconds (leader election).
- Multiple Brokers: Restart one by one, prioritize critical partitions.
- Disk Failure: Replace disk, resync data (2-8 hours).
- Controller: Auto-elects new controller (<30 seconds).
- ZK Quorum Loss: Restore quorum ASAP (cluster frozen otherwise).
- Network Partition: Fix network, don't restart brokers.
- Full Cluster: Start ZK first, then brokers one by one.
What's Next?
Next Module: 10.3.3 – KRaft vs ZooKeeper Resilience
References:
- Broker configs → M6: Operations
- Replication internals → M7: Kafka Internals