kafka KRaft模式报:Invalid value test for configuration process.roles: String must be one of: broker, controller

啊啊 发表于: 2021-09-28   最后更新时间: 2021-09-28 16:04:39   1,691 游览

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

ERROR Exiting Kafka due to fatal exception (kafka.Kafka$)
org.apache.kafka.common.config.ConfigException: Invalid value test for configuration process.roles: String must be one of: broker, controller

错误详情:

[2021-09-28 07:15:23,133] INFO Registered kafka:type=kafka.Log4jController MBean (kafka.utils.Log4jControllerRegistration$)
[2021-09-28 07:15:23,577] ERROR Exiting Kafka due to fatal exception (kafka.Kafka$)
org.apache.kafka.common.config.ConfigException: Invalid value test for configuration process.roles: String must be one of: broker, controller
  at org.apache.kafka.common.config.ConfigDef$ValidString.ensureValid(ConfigDef.java:961)
  at org.apache.kafka.common.config.ConfigDef$ValidList.ensureValid(ConfigDef.java:937)
  at org.apache.kafka.common.config.ConfigDef.parseValue(ConfigDef.java:499)
  at org.apache.kafka.common.config.ConfigDef.parse(ConfigDef.java:483)
  at org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:113)
  at org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:146)
  at kafka.server.KafkaConfig.<init>(KafkaConfig.scala:1391)
  at kafka.server.KafkaConfig.<init>(KafkaConfig.scala:1394)
  at kafka.Kafka$.buildServer(Kafka.scala:67)
  at kafka.Kafka$.main(Kafka.scala:87)
  at kafka.Kafka.main(Kafka.scala)

我的server.properties配置如下:

process.roles=master

请问我该如何解决?

发表于 2021-09-28

process.roles只支持配置broker, controller这2个参数,所以你的master是不认的(我也不知道你哪里看到的这个值)。

正确的是:

process.roles=broker,controller

process.roles=broker

process.roles=controller
你的答案

查看kafka相关的其他问题或提一个您自己的问题