kafka启动失败,查看日志文件发现如下错误:
ERROR Fatal error during KafkaServer startup. Prepare to shutdown (
kafka.server.KafkaServer)
kafka.common.InconsistentClusterIdException: The Cluster ID ScWT4V1zQPaLgxVyloWyCw doesn't ma
tch stored clusterId Some(ABfHGIgVR7G0JgOJddV5OQ) in meta.properties. The broker is trying to
join the wrong cluster. Configured zookeeper.connect may be wrong.
解决:将kafka恢复到初始状态
1.删除kafka下的logs文件
2.将配置文件server.properties中配置的log.dirs=/opt/data/kafkadata中的数据清除
3.重新启动kafka即可,前提是启动zookeeper