A Kafka broker restarting continuously is a sign of critical misconfigurations or runtime failures.
š„ Common Causes
- Corrupted data in
log.dirs
- Port conflict on 9092
- Incorrect
zookeeper.connect
- Heap OutOfMemoryError
- Missing Java or mismatched JDK version
š ļø How to Fix
- Check logs:
/var/log/kafka/server.log
- Delete corrupted topic logs (if necessary):
rm -rf /tmp/kafka-logs/<topic-name>/
- Increase
Xmx
inKAFKA_HEAP_OPTS
- Use
jstack
to debug JVM hangs