[kafka] kafka.common.InconsistentBrokerIdException: Configured broker.id 2 doesn't match stored broker.id 0 in meta.properties 해결 하기
kafka 2017. 2. 28. 17:58config/server.properties 파일에 broker.id를 수정 후 재시작했다가 다시 broker.id를 수정한 경우에 발생하는 경우이다.
[2017-02-28 17:42:29,272] FATAL Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
kafka.common.InconsistentBrokerIdException: Configured broker.id 2 doesn't match stored broker.id 0 in meta.properties. If you moved your data, make sure your configured broker.id matches. If you intend to create a new broker, you should remove all data in your data directories (log.dirs).
at kafka.server.KafkaServer.getBrokerId(KafkaServer.scala:687)
at kafka.server.KafkaServer.startup(KafkaServer.scala:213)
at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:39)
at kafka.Kafka$.main(Kafka.scala:67)
at kafka.Kafka.main(Kafka.scala)
[2017-02-28 17:42:29,275] INFO shutting down (kafka.server.KafkaServer)
[2017-02-28 17:42:29,278] INFO Shutting down. (kafka.log.LogManager)
[2017-02-28 17:42:29,287] INFO Shutdown complete. (kafka.log.LogManager)
[2017-02-28 17:42:29,288] INFO Terminate ZkClient event thread. (org.I0Itec.zkclient.ZkEventThread)
[2017-02-28 17:42:29,293] INFO Session: 0x25a83bf8af20003 closed (org.apache.zookeeper.ZooKeeper)
[2017-02-28 17:42:29,296] INFO EventThread shut down for session: 0x25a83bf8af20003 (org.apache.zookeeper.ClientCnxn)
[2017-02-28 17:42:29,296] INFO shut down completed (kafka.server.KafkaServer)
[2017-02-28 17:42:29,297] FATAL Fatal error during KafkaServerStartable startup. Prepare to shutdown (kafka.server.KafkaServerStartable)
kafka.common.InconsistentBrokerIdException: Configured broker.id 2 doesn't match stored broker.id 0 in meta.properties. If you moved your data, make sure your configured broker.id matches. If you intend to create a new broker, you should remove all data in your data directories (log.dirs).
at kafka.server.KafkaServer.getBrokerId(KafkaServer.scala:687)
at kafka.server.KafkaServer.startup(KafkaServer.scala:213)
at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:39)
at kafka.Kafka$.main(Kafka.scala:67)
at kafka.Kafka.main(Kafka.scala)
config/server.properties 파일에 log.dirs 디폴트 위치가 /tmp/kafka-logs이다.
# A comma seperated list of directories under which to store log files
log.dirs=/tmp/kafka-logs
살펴보니. broker-id이다.
$ cat /tmp/kafka-logs/meta.properties
#
#Tue Feb 28 17:30:11 KST 2017
version=0
broker.id=0
다음을 실행하고 다시 kafka를 실행하면 더 이상 위의 에러는 발생하지 않는다.
$ rm /tmp/kafka-logs/meta.properties
'kafka' 카테고리의 다른 글
[kafka] 0.10.1.1 사용하면서 api 사용시 ProducerConfig와 ConsumerConfig를 잘 참조한다 (0) | 2017.03.16 |
---|---|
[kafka] 구축 사례 - linkedin, uber, twitter, spotify, yahoo (0) | 2017.03.13 |
[kafka] kafka 0.10.1.1 - producer / consumer 중요 내용 (0) | 2017.03.08 |
kafka 0.8과 kafka 0.10 의 Partitioner 변경 내용 (0) | 2017.03.02 |
[kafka] 0.10.1.1 설치, topic 생성/삭제/수정, 메시지 송신/발신 테스트 (2) | 2017.02.28 |