返回到文章

采纳

编辑于 3年前

kafka KRaft模式报:Invalid configuration value for controller.quorum.voters. Each entry should be in the form `{id}@{host}:{port}`.

kafka

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

ERROR Exiting Kafka due to fatal exception (kafka.Kafka$)
org.apache.kafka.common.config.ConfigException: Invalid configuration value for controller.quorum.voters. Each entry should be in the form {id}@{host}:{port}.

错误详情:

[2021-09-28 07:49:45,061] INFO Registered kafka:type=kafka.Log4jController MBean (kafka.utils.Log4jControllerRegistration$)
[2021-09-28 07:49:45,488] ERROR Exiting Kafka due to fatal exception (kafka.Kafka$)
org.apache.kafka.common.config.ConfigException: Invalid configuration value for controller.quorum.voters. Each entry should be in the form `{id}@{host}:{port}`.
    at org.apache.kafka.raft.RaftConfig.parseVoterConnections(RaftConfig.java:214)
    at org.apache.kafka.raft.RaftConfig$ControllerQuorumVotersValidator.ensureValid(RaftConfig.java:270)
    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=broker,controller
controller.quorum.voters=172.21.0.1:9092,172.21.0.1:9093,172.21.0.1:9094

请问我该如何解决?