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.
    TermDescription
    Consumer lagRecords behind latest offset.
    URPUnder-replicated partitions.
    Poison messageBlocks processing at offset.
    Offset resetSkip 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

    1. Alert — Lag, URP, error rate.
    2. Diagnose — Partition-level view.
    3. Fix — DLT, scale, rollback.
    4. Postmortem — Document root cause.

    Informative example

    Example:

    bash
    kafka-topics --bootstrap-server localhost:9092 --create --topic cluster-recovery --partitions 6 --replication-factor 3
    kafka-console-producer --bootstrap-server localhost:9092 --topic cluster-recovery
    kafka-console-consumer --bootstrap-server localhost:9092 --topic cluster-recovery --from-beginning
    kafka-consumer-groups --bootstrap-server localhost:9092 --describe --group cluster-recovery-service

    Execution workflow

    1Cluster Recovery workflow
    1 / 4

    Alert

    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.