본문 바로가기
IT/MSA

아파치 카프카 실행 에러(kafka.common.InconsistentClusterIdException: The Cluster ID doesn't match stored clusterId Some in meta.properties. The broker is trying to join the wrong cluster. Configured zookeeper.connect may be wrong.)

by twofootdog 2020. 12. 12.

아파치 카프카가 시작이 정상적으로 되지 않는 경우가 있다.

로그파일(카프카 설치디렉토리/logs/server.log)를 확인해 보니 아래와 같은 에러가 발생하였다.

kafka.common.InconsistentClusterIdException: The Cluster ID X5OzZfF9RaG-mSIwzW684w doesn't match stored clusterId Some(P2GQ3DlJTFusFPnSeKeQJw) 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:235)
        at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:44)
        at kafka.Kafka$.main(Kafka.scala:82)
        at kafka.Kafka.main(Kafka.scala)
[2020-12-11 17:20:06,537] INFO shutting down (kafka.server.KafkaServer)
[2020-12-11 17:20:06,544] INFO [ZooKeeperClient Kafka server] Closing. (kafka.zookeeper.ZooKeeperClient)
[2020-12-11 17:20:06,651] INFO Session: 0x1000004cc320003 closed (org.apache.zookeeper.ZooKeeper)
[2020-12-11 17:20:06,652] INFO [ZooKeeperClient Kafka server] Closed. (kafka.zookeeper.ZooKeeperClient)
[2020-12-11 17:20:06,657] INFO EventThread shut down for session: 0x1000004cc320003 (org.apache.zookeeper.ClientCnxn)
[2020-12-11 17:20:06,664] INFO shut down completed (kafka.server.KafkaServer)
[2020-12-11 17:20:06,668] ERROR Exiting Kafka. (kafka.server.KafkaServerStartable)
[2020-12-11 17:20:06,676] INFO shutting down (kafka.server.KafkaServer)

 


해결방법 : 

카프카 설정파일(카프카 설치 디렉토리/config/server.properties)의 log.dirs 항목에서 설정되어 있는 카프카 로그 path로 가보면 meta.properties라는 파일이 있는데 해당 파일을 지워주고 카프카를 재시작해주면 해결된다.

 

카프카 설치 디렉토리/config/server.properties 파일 : 

$ cd [log-dir]
$ rm -rf meta.properties
$ systemctl restart kafka-server

 


참고

stackoverflow.com/questions/59481878/unable-to-start-kafka-with-zookeeper-kafka-common-inconsistentclusteridexceptio

 

Unable to start kafka with zookeeper (kafka.common.InconsistentClusterIdException)

Below the steps I did to get this issue : Launch ZooKeeper Launch Kafka : .\bin\windows\kafka-server-start.bat .\config\server.properties And at the second step the error happens : ERROR Fatal

stackoverflow.com

 

댓글