Invalid receive (size = 369296129 larger than 524288)

g 发表于: 2024-05-22   最后更新时间: 2024-05-23 10:01:33   823 游览

Invalid receive (size = 369296129 larger than 524288)

kafka配置SASL/SCRAM,启动后重复报错如下:

org.apache.kafka.common.network.InvalidReceiveException: Invalid receive (size = 369296129 larger than 524288)

配置信息如下(部分信息隐去)

broker.id=1
listeners=SASL_PLAINTEXT://:。。。。
advertised.listeners=SASL_PLAINTEXT://。。。。:。。。。
log.dirs=/opt/kafka-2.7/data
zookeeper.connect=。。。。。。。。。。。。。
security.inter.broker.protocol=SASL_PLAINTEXT
sasl.mechanism.inter.broker.protocol=SCRAM-SHA-512
sasl.enabled.mechanisms=PLAIN,SCRAM-SHA-512
zookeeper.set.acl=true
authorizer.class.name=kafka.security.authorizer.AclAuthorizer
super.users=User:admin;User:kafka
replica.fetch.max.bytes=369296129
message.max.bytes=369296129
default.replication.factor=2
num.partitions=3
delete.topic.enable=true
auto.create.topics.enable=true
num.network.threads=3
num.io.threads=8
socket.send.buffer.bytes=369296129
socket.receive.buffer.bytes=369296129
socket.request.max.bytes=369296129
num.recovery.threads.per.data.dir=1
offsets.topic.replication.factor=1
transaction.state.log.replication.factor=1
transaction.state.log.min.isr=1
log.retention.hours=168
log.segment.bytes=1073741824
log.retention.check.interval.ms=300000
zookeeper.connection.timeout.ms=18000
group.initial.rebalance.delay.ms=0

报错信息

 WARN [SocketServer brokerId=1] Unexpected error from /。。。。; closing connection (org.apache.kafka.common.network.Selector)
org.apache.kafka.common.network.InvalidReceiveException: Invalid receive (size = 369296129 larger than 524288)
        at org.apache.kafka.common.network.NetworkReceive.readFrom(NetworkReceive.java:105)
        at org.apache.kafka.common.security.authenticator.SaslServerAuthenticator.authenticate(SaslServerAuthenticator.java:249)
        at org.apache.kafka.common.network.KafkaChannel.prepare(KafkaChannel.java:176)
        at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:543)
        at org.apache.kafka.common.network.Selector.poll(Selector.java:481)
        at kafka.network.Processor.poll(SocketServer.scala:923)
        at kafka.network.Processor.run(SocketServer.scala:826)
        at java.lang.Thread.run(Thread.java:750)

也尝试修改为如下,或者只修改socket.request.max.bytes,还是重复报错 Invalid receive (size = 369296129 larger than 524288)

replica.fetch.max.bytes=419430400
message.max.bytes=419430400
socket.send.buffer.bytes=419430400
socket.receive.buffer.bytes=419430400
socket.request.max.bytes=419430400

求大佬指教

发表于 2024-05-22
g
添加评论

全网都没找到好的解决方法,建议升级kafka版本,可以在新的版本中已经修复了。

你的答案

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