kafka报If process.roles does not contain the 'controller' role, the node id 0 must not be included in the set of voters controller.quorum.voters=Set(0)

啊啊 发表于: 2021-09-28   最后更新时间: 2021-09-28 16:34:02   1,241 游览

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

ERROR Exiting Kafka due to fatal exception (kafka.Kafka$)
java.lang.IllegalArgumentException: requirement failed: If process.roles does not contain the 'controller' role, the node id 0 must not be included in the set of voters controller.quorum.voters=Set(0)

错误详情:

[2021-09-28 08:02:29,085] INFO Registered kafka:type=kafka.Log4jController MBean (kafka.utils.Log4jControllerRegistration$)
[2021-09-28 08:02:29,527] INFO Setting -D jdk.tls.rejectClientInitiatedRenegotiation=true to disable client-initiated TLS renegotiation (org.apache.zookeeper.common.X509Util)
[2021-09-28 08:02:29,570] ERROR Exiting Kafka due to fatal exception (kafka.Kafka$)
java.lang.IllegalArgumentException: requirement failed: If process.roles does not contain the 'controller' role, the node id 0 must not be included in the set of voters controller.quorum.voters=Set(0)
    at scala.Predef$.require(Predef.scala:337)
    at kafka.server.KafkaConfig.validateValues(KafkaConfig.scala:1926)
    at kafka.server.KafkaConfig.<init>(KafkaConfig.scala:1897)
    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=broker
controller.quorum.voters=172.21.0.1:9092,172.21.0.1:9093,172.21.0.1:9094

请问我该如何解决?

发表于 2021-09-28
添加评论

If process.roles does not contain the 'controller' role, the node id 0 must not be included in the set of voters controller.quorum.voters=Set(0)
如果process.roods不包含controller角色,那么节点id 0一定不包括在投票者集合中 controller.quorum.voters=Set(0)

意思就是你的borker不是控制角色,所以不能写到controller.quorum.voters投票名单中。

你的答案

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