Kafka Disk or Log-Directory Failure
Use this playbook for disk exhaustion, inode exhaustion, high I/O latency, missing mounts, read-only filesystems, or KafkaStorageException/LogDirFailureException.
Capture Evidence
Section titled “Capture Evidence”kafka-log-dirs.sh --bootstrap-server kafka:9092 --describedf -h /var/lib/kafkadf -i /var/lib/kafkafindmnt /var/lib/kafkaiostat -xz 1 10journalctl -k --since "30 minutes ago"Record the directory ID, affected replicas, device, mount source/options, capacity and inode use, latency, kernel errors, and recent storage changes.
Immediate Containment
Section titled “Immediate Containment”- Stop unrelated processes from consuming the volume.
- Prevent new replica placement by cordoning the affected directory or broker.
- Preserve Kafka and kernel logs before restarting.
- If the root filesystem is filling, confirm Kafka did not start against an empty fallback directory after a mount failed.
Diagnose
Section titled “Diagnose”| Symptom | Check |
|---|---|
| 100% bytes | Retention, unexpected growth, missing tiered-copy progress, other files |
| 100% inodes | Segment count, tiny files, non-Kafka files |
| High await/utilization | Device saturation, noisy neighbor, compaction, reassignments |
| Read-only mount | Kernel/filesystem error and device health |
| Permission failure | Ownership, mode, security policy, mount change |
| One failed directory | Device and directory-specific replicas, not only broker health |
Recover
Section titled “Recover”Evacuate replicas through reassignment when the directory remains readable. Replace the failed device or mount, then initialize only the replacement directory according to the broker storage procedure. Let Kafka rebuild replicas from healthy leaders.
Danger
Do not delete segment, index, checkpoint, or meta.properties files while Kafka is running. Do not copy arbitrary partition files into another live replica, and never run fsck on a mounted filesystem.
Verify
Section titled “Verify”- The intended mount is present after restart.
kafka-log-dirs.shreports no directory error.- Replicas catch up and ISR returns to normal.
- Disk latency, space, and inode growth remain within thresholds.
- Temporary cordons and reassignment throttles are removed deliberately.
See cluster management for directory evacuation.