kafka.common.InconsistentClusterIdException

standard2hsw·2023년 1월 23일
0

kafka

목록 보기
1/1
post-thumbnail

현재 클라이언트가 연결하려는 카프카 클러스터와 이전에 연결한 카프카 클러스터의 "cluster id"가 다르기 때문에 발생하는 문제입니다. 그래서 meta 데이터의 문제로 kafka는 controller broker가 선언되지 않았고 controller broker의 부재로 인하여 Topic과 Partition의 관리가 안되는 현상이 발생합니다.

Error message

[2022-08-04 01:42:38,833] ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
kafka.common.InconsistentClusterIdException: The Cluster ID Ap0xMkY_TIyx9Ntyq565Pg doesn't match stored clusterId Some(LwpqAcZKQXCPnInmC0w2sw) in meta.properties. The broker is trying to join the wrong cluster. Configured zookeeper.connect may be wrong

문제 해결 방법 1

먼저 server.properties 파일에 지정한 log.dirs의 경로를 알아야 합니다. log.dirs 경로를 확인하고 각각의 브로커로 들어가서 meta.properties 파일을 삭제합니다.

rm -f (log.dirs명시한 경로)/meta.properties

카프카 재시작
meta.properties 파일을 삭제하였다면 카프카를 재시작합니다.

문제 해결 방법 2

위에서 각각의 브로커의 meta.properties 파일에 cluster id를 통일 시킨 후 카프카를 재시작한다.

마지막으로

이 해결 방안은 일시적인 해결책입니다. 즉 해당 Exception이 또 발생할 가능성이 있습니다. 좀 더 카프카에 대해 배워서 해당 문제가 또 발생하지 않는 방법을 찾아야 될 것 같습니다. 보다 더 좋은 해결책을 아신다면 공유 부탁드립니다.

profile
그냥 기억하기 싫어서 기록하는 블로그

0개의 댓글