Apache Kafka Tutorial 0/111 lessons ~6 min read Lesson 71
Cluster Recovery
What is Cluster Recovery?
Course progress0%
Focus
9 guided sections
Practice signal
Examples included
Career prep
Foundation builder
Introduction
What is Cluster Recovery? Cluster recovery requires understanding broker restarts, partition leadership, ISR, controller state, disk replacement, and client retry behavior.
Understanding the topic
What happens — Cluster Recovery:
- Identify topic, partition, offset scope.
- Check broker health and ISR.
- Inspect consumer errors and deploys.
- Remediate: scale, DLT, replay, or fix schema.
| Term | Description |
|---|---|
| Consumer lag | Records behind latest offset. |
| URP | Under-replicated partitions. |
| Poison message | Blocks processing at offset. |
| Offset reset | Skip or replay — use carefully. |
Visual explanation
Pipeline view:
text
Topic partitions↓replicas across brokers↓ISR health↓disk + network + controller↓SLO dashboards
Step-by-step explanation
- Alert — Lag, URP, error rate.
- Diagnose — Partition-level view.
- Fix — DLT, scale, rollback.
- Postmortem — Document root cause.
Informative example
Example:
bash
kafka-topics --bootstrap-server localhost:9092 --create --topic cluster-recovery --partitions 6 --replication-factor 3kafka-console-producer --bootstrap-server localhost:9092 --topic cluster-recoverykafka-console-consumer --bootstrap-server localhost:9092 --topic cluster-recovery --from-beginningkafka-consumer-groups --bootstrap-server localhost:9092 --describe --group cluster-recovery-service
Execution workflow
1Cluster Recovery workflow
1 / 4Alert
Lag, URP, error rate.
Best practices
- Use replication factor 3 for critical topics.
- Set min.insync.replicas with acks=all.
- Alert on under-replicated partitions, offline partitions, disk usage, and lag.
- Document topic ownership and cleanup policy.
Common mistakes
- Changing partitions without understanding ordering impact.
- Ignoring hot partitions caused by skewed keys.
- Letting retention grow until disks become the outage.
Summary
Cluster Recovery — Operate Kafka through SLOs: durability, availability, latency, lag, disk headroom, and recovery time.
Ready to mark this lesson complete?Track your journey across the entire course.