# LogDirOfflineException：一个或多个日志目录离线。

- **ID:** `kafka/log-dir-offline`
- **领域:** kafka
- **类别:** system_error
- **验证级别:** ai_generated
- **修复率:** 70%

## 根因

磁盘故障或文件系统问题导致一个或多个 Kafka 数据目录无法访问，从而导致这些分区的代理不可用。

## 解决方案

1. ```
   Identify the offline directory from broker logs: `grep 'offline' /var/log/kafka/server.log`. Then unmount and check the disk with `fsck`, or replace it. After repair, restart the broker. Example: `sudo umount /data/kafka && sudo fsck -y /dev/sdb1 && sudo mount /data/kafka && kafka-server-start.sh config/server.properties`.
   ```

## 无效尝试

- **** — Simply restarting the broker without addressing the disk failure will cause the same error; the broker will detect the offline directory again. (90% 失败率)
- **** — Increasing log retention or cleanup policies doesn't fix a hardware failure; the underlying disk must be repaired or replaced. (95% 失败率)
