返回到文章

采纳

编辑于 3年前

kafka KRaft报ERROR Exiting Kafka due to fatal exception No `meta.properties` found in /var/lib/kafka

kafka

我使用kafka 3.0.0的KRaft模式,安装kafka集群,报:

[2021-09-30 10:00:54,480] ERROR Exiting Kafka due to fatal exception (kafka.Kafka$)
No meta.properties found in /var/lib/kafka (have you run kafka-storage.sh to format the directory?)

错误详情:

[2021-09-30 10:00:54,480] ERROR Exiting Kafka due to fatal exception (kafka.Kafka$)
kafka.common.KafkaException: No `meta.properties` found in /var/lib/kafka (have you run `kafka-storage.sh` to format the directory?)
    at kafka.server.BrokerMetadataCheckpoint$.$anonfun$getBrokerMetadataAndOfflineDirs$2(BrokerMetadataCheckpoint.scala:164)
    at scala.collection.immutable.List.foreach(List.scala:333)
    at kafka.server.BrokerMetadataCheckpoint$.getBrokerMetadataAndOfflineDirs(BrokerMetadataCheckpoint.scala:153)
    at kafka.server.KafkaRaftServer$.initializeLogDirs(KafkaRaftServer.scala:151)
    at kafka.server.KafkaRaftServer.<init>(KafkaRaftServer.scala:53)
    at kafka.Kafka$.buildServer(Kafka.scala:79)
    at kafka.Kafka$.main(Kafka.scala:87)
    at kafka.Kafka.main(Kafka.scala)

我的启动命令是:

bin/kafka-server-start.sh config/server.properties

请问我该如何解决?