config/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


Posted by '김용환'
,