注意:
kafka集群部署在zookeeper集群之上的,启动kafka之前应该先启动zookeeper
异常:
当Kafka出现异常时,强行关闭kafka集群或zookeeper集群时,重新启动时经常会出现异常 kafka.common.InconsistentClusterIdException
ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
kafka.common.InconsistentClusterIdException: The Cluster ID LGPATcBERBykLsaBvK95Ww doesn't match stored clusterId Some(NXVjnxtkToCW9Lr_3K5r9g) 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:218)
at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:44)
at kafka.Kafka$.main(Kafka.scala:84)
at kafka.Kafka.main(Kafka.scala)