Apache Kafka启动错误 – 配置消息格式版本的值无效 3.0-IV1。

huangapple go评论75阅读模式
英文:

Apache Kafka StartUp Error - Invalid value 3.0-IV1 for configuration message.format.version

问题

我已在Microsoft WSL(Linux分发版Ubuntu 18)上安装了Apache Kafka,突然间在我们的本地机器上启动kafka时出现了这个错误。

我们尝试删除tmp\kafka-logs,但仍然无法正常工作。我还检查了kafka server.properties文件,但也找不到任何问题。我们还下载了更高版本的kafka并尝试运行,但仍然出现相同的错误。所以看起来Kafka之外的某些配置不正确?

org.apache.kafka.common.config.ConfigException: 配置message.format.version的值无效:版本3.0-IV1不是有效版本

[2023-08-10 12:24:12,421] INFO [ThrottledChannelReaper-Fetch]: 启动(kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2023-08-10 12:24:12,421] INFO [ThrottledChannelReaper-Produce]: 启动(kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2023-08-10 12:24:12,422] INFO [ThrottledChannelReaper-Request]: 启动(kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2023-08-10 12:24:12,542] ERROR [KafkaServer id=0] KafkaServer启动期间发生致命错误。准备关闭(kafka.server.KafkaServer)
org.apache.kafka.common.config.ConfigException: 配置message.format.version的值无效:版本`3.0-IV1`不是有效版本
        在kafka.api.ApiVersionValidator$.ensureValid(ApiVersion.scala:361)处确保有效
        在org.apache.kafka.common.config.ConfigDef.parseValue(ConfigDef.java:484)处解析值
        在org.apache.kafka.common.config.ConfigDef.parse(ConfigDef.java:468)处解析
        在org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:108)处
        在org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:142)处
        在kafka.log.LogConfig.<init>(LogConfig.scala:71)处
        在kafka.log.LogConfig$.fromProps(LogConfig.scala:314)处
        在kafka.zk.KafkaZkClient.$anonfun$getLogConfigs$2(KafkaZkClient.scala:313)处
        在scala.collection.IterableOnceOps.foreach(IterableOnce.scala:553)处
        在scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:551)处
        在scala.collection.AbstractIterable.foreach(Iterable.scala:920)处
        在kafka.zk.KafkaZkClient.getLogConfigs(KafkaZkClient.scala:308)处
        在kafka.log.LogManager$.apply(LogManager.scala:1090)处
        在kafka.server.KafkaServer.startup(KafkaServer.scala:273)处
        在kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:44)处
        在kafka.Kafka$.main(Kafka.scala:82)处
        在kafka.Kafka.main(Kafka.scala)处
[2023-08-10 12:24:12,544] INFO [KafkaServer id=0] 关闭中(kafka.server.KafkaServer)
[2023-08-10 12:24:12,546] INFO [ZooKeeperClient Kafka服务器] 关闭中。(kafka.zookeeper.ZooKeeperClient)
[2023-08-10 12:24:12,660] INFO 会话:0x1000006a11f0002已关闭(org.apache.zookeeper.ZooKeeper)
[2023-08-10 12:24:12,660] INFO EventThread关闭中的会话:0x1000006a11f0002(org.apache.zookeeper.ClientCnxn)
[2023-08-10 12:24:12,661] INFO [ZooKeeperClient Kafka服务器]已关闭。(kafka.zookeeper.ZooKeeperClient)
[2023-08-10 12:24:12,662] INFO [ThrottledChannelReaper-Fetch]: 关闭中(kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2023-08-10 12:24:13,422] INFO [ThrottledChannelReaper-Fetch]: 已停止(kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2023-08-10 12:24:13,422] INFO [ThrottledChannelReaper-Fetch]: 关闭已完成(kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2023-08-10 12:24:13,422] INFO [ThrottledChannelReaper-Produce]: 关闭中(kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2023-08-10 12:24:14,421] INFO [ThrottledChannelReaper-Produce]: 已停止(kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2023-08-10 12:24:14,421] INFO [ThrottledChannelReaper-Produce]: 关闭已完成(kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2023-08-10 12:24:14,422] INFO [ThrottledChannelReaper-Request]: 关闭中(kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2023-08-10 12:24:14,422] INFO [ThrottledChannelReaper-Request]: 已停止(kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2023-08-10 12:24:14,422] INFO [ThrottledChannelReaper-Request]: 关闭已完成(kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2023-08-10 12:24:14,429] INFO [KafkaServer id=0] 关闭已完成(kafka.server.KafkaServer)
[2023-08-10 12:24:14,430] ERROR 退出Kafka。(kafka.server.KafkaServerStartable)
[2023-08-10 12:24:14,430] INFO [KafkaServer id=0] 关闭中(kafka.server.KafkaServer)
英文:

I have got Apache Kafka installed on Microsoft WSL (Linux Distribution Ubuntu 18) and all of a sudden we are getting this error on our local machine when starting kafka.

We tried deleting tmp\kafka-logs as well but it still doesn't work. I have checked kafka server.properties file as well and can't find anything there either. We also downloaded a higher version of kafka and tried running that and still same error. So it looks like some config is not right outside Kafka?

org.apache.kafka.common.config.ConfigException: Invalid value 3.0-IV1 for configuration message.format.version: Version 3.0-IV1 is not a valid version

[2023-08-10 12:24:12,421] INFO [ThrottledChannelReaper-Fetch]: Starting (kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2023-08-10 12:24:12,421] INFO [ThrottledChannelReaper-Produce]: Starting (kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2023-08-10 12:24:12,422] INFO [ThrottledChannelReaper-Request]: Starting (kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2023-08-10 12:24:12,542] ERROR [KafkaServer id=0] Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
org.apache.kafka.common.config.ConfigException: Invalid value 3.0-IV1 for configuration message.format.version: Version `3.0-IV1` is not a valid version
        at kafka.api.ApiVersionValidator$.ensureValid(ApiVersion.scala:361)
        at org.apache.kafka.common.config.ConfigDef.parseValue(ConfigDef.java:484)
        at org.apache.kafka.common.config.ConfigDef.parse(ConfigDef.java:468)
        at org.apache.kafka.common.config.AbstractConfig.&lt;init&gt;(AbstractConfig.java:108)
        at org.apache.kafka.common.config.AbstractConfig.&lt;init&gt;(AbstractConfig.java:142)
        at kafka.log.LogConfig.&lt;init&gt;(LogConfig.scala:71)
        at kafka.log.LogConfig$.fromProps(LogConfig.scala:314)
        at kafka.zk.KafkaZkClient.$anonfun$getLogConfigs$2(KafkaZkClient.scala:313)
        at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:553)
        at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:551)
        at scala.collection.AbstractIterable.foreach(Iterable.scala:920)
        at kafka.zk.KafkaZkClient.getLogConfigs(KafkaZkClient.scala:308)
        at kafka.log.LogManager$.apply(LogManager.scala:1090)
        at kafka.server.KafkaServer.startup(KafkaServer.scala:273)
        at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:44)
        at kafka.Kafka$.main(Kafka.scala:82)
        at kafka.Kafka.main(Kafka.scala)
[2023-08-10 12:24:12,544] INFO [KafkaServer id=0] shutting down (kafka.server.KafkaServer)
[2023-08-10 12:24:12,546] INFO [ZooKeeperClient Kafka server] Closing. (kafka.zookeeper.ZooKeeperClient)
[2023-08-10 12:24:12,660] INFO Session: 0x1000006a11f0002 closed (org.apache.zookeeper.ZooKeeper)
[2023-08-10 12:24:12,660] INFO EventThread shut down for session: 0x1000006a11f0002 (org.apache.zookeeper.ClientCnxn)
[2023-08-10 12:24:12,661] INFO [ZooKeeperClient Kafka server] Closed. (kafka.zookeeper.ZooKeeperClient)
[2023-08-10 12:24:12,662] INFO [ThrottledChannelReaper-Fetch]: Shutting down (kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2023-08-10 12:24:13,422] INFO [ThrottledChannelReaper-Fetch]: Stopped (kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2023-08-10 12:24:13,422] INFO [ThrottledChannelReaper-Fetch]: Shutdown completed (kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2023-08-10 12:24:13,422] INFO [ThrottledChannelReaper-Produce]: Shutting down (kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2023-08-10 12:24:14,421] INFO [ThrottledChannelReaper-Produce]: Stopped (kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2023-08-10 12:24:14,421] INFO [ThrottledChannelReaper-Produce]: Shutdown completed (kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2023-08-10 12:24:14,422] INFO [ThrottledChannelReaper-Request]: Shutting down (kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2023-08-10 12:24:14,422] INFO [ThrottledChannelReaper-Request]: Stopped (kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2023-08-10 12:24:14,422] INFO [ThrottledChannelReaper-Request]: Shutdown completed (kafka.server.ClientQuotaManager$ThrottledChannelReaper)
[2023-08-10 12:24:14,429] INFO [KafkaServer id=0] shut down completed (kafka.server.KafkaServer)
[2023-08-10 12:24:14,430] ERROR Exiting Kafka. (kafka.server.KafkaServerStartable)
[2023-08-10 12:24:14,430] INFO [KafkaServer id=0] shutting down (kafka.server.KafkaServer)

答案1

得分: 1

好的,所以我成功地解决了它,方法是删除这两个文件夹(kafka-logszookeeper)。原来一些主题有一些格式不正确的数据。但请注意,通过这样做,你可能会丢失所有的主题。在我的情况下没关系,因为这是我的本地环境,我可以重新创建它。

\\wsl.localhost\Ubuntu-20.04\tmp\kafka-logs
\\wsl.localhost\Ubuntu-20.04\tmp\zookeeper
英文:

Ok so I was able to solve it by deleting these two folders (kafka-logs and zookeeper). It turns out some of the topics had some badly formatted data. But just note that by doing that you could loose all your topics. In my case it was ok because it's my local environment and I can just recreate it.

\\wsl.localhost\Ubuntu-20.04\tmp\kafka-logs
\\wsl.localhost\Ubuntu-20.04\tmp\zookeeper

huangapple
  • 本文由 发表于 2023年8月10日 09:58:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/76872203.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定