报错
ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
kafka.common.InconsistentClusterIdException: The Cluster ID lWXm_NMhTdyWWb0VhVJqLw doesn’t match stored clusterId Some(5_QiXBs-SESQnOPIRAd9EA) in meta.properties. The broker is trying to join the wrong cluster. Configured zookeeper.connect may be wrong.
at kafka.server.KafkaServer.startup(KafkaServer.scala:220)
at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:44)
at kafka.Kafka$.main(Kafka.scala:84)
at kafka.Kafka.main(Kafka.scala)
在启动bin/kafka-server-start.sh时报错,错误原因跟server.properties中的文件有关。
参考文章:kafka伪集群搭建常见错误
将log.dir对应的存储文件夹删除后,新建新的文件夹。然后重启Kafka,执行成功!