kafka KRaft报inter.broker.listener.name must be a listener name defined in advertised.listeners. The valid options based on currently configured listen

啊啊 发表于: 2021-09-28   最后更新时间: 2021-09-28 18:14:19   5,442 游览

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

java.lang.IllegalArgumentException: requirement failed: inter.broker.listener.name must be a listener name defined in advertised.listeners. The valid options based on currently configured listeners are

错误详情:

[2021-09-28 09:40:28,126] INFO Registered kafka:type=kafka.Log4jController MBean (kafka.utils.Log4jControllerRegistration$)
[2021-09-28 09:40:28,602] INFO Setting -D jdk.tls.rejectClientInitiatedRenegotiation=true to disable client-initiated TLS renegotiation (org.apache.zookeeper.common.X509Util)
[2021-09-28 09:40:28,695] ERROR Exiting Kafka due to fatal exception (kafka.Kafka$)
java.lang.IllegalArgumentException: requirement failed: inter.broker.listener.name must be a listener name defined in advertised.listeners. The valid options based on currently configured listeners are 
    at scala.Predef$.require(Predef.scala:337)
    at kafka.server.KafkaConfig.validateValues(KafkaConfig.scala:1952)
    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配置如下:

listeners=PLAINTEXT://172.21.0.1:9092
process.roles=broker
controller.quorum.voters=172.21.0.1:9092,172.21.0.1:9093,172.21.0.1:9094
controller.listener.names=PLAINTEXT

请问我该如何解决?

发表于 2021-09-28
在线,8小时前登录
添加评论

inter.broker.listener.name must be a listener name defined in advertised.listeners. The valid options based on currently configured listeners are

翻译过来就是

inter.broker.listener.name 必须是 adverted.listeners 中定义的 listeners 名称。基于当前配置的listeners的有效选项

你需要内部broker之间指定一个网口进行内部交互,配置inter.broker.listener.name,如:

listeners=PLAINTEXT://172.21.0.1:9092,PLAINTEXT1://172.21.0.1:9091
advertised.listeners=PLAINTEXT1://172.21.0.1:9091
listener.security.protocol.map=PLAINTEXT1:PLAINTEXT,PLAINTEXT:PLAINTEXT
controller.listener.names=PLAINTEXT
inter.broker.listener.name=PLAINTEXT1
你的答案

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