返回到文章

采纳

编辑于 1年前

kafka broker调整log.setment.bytes之后报RecordBatchTooLargeException: The request included message batch larger than the configured segment size on the server.

kafka

kafka broker的配置参数有一个log.segment.bytes指的是单个日志文件存储的消息容量的最大值,该值最小是14bytes,测试时将该值设成了14,按道理小于14bytes的消息应该仍能写入日志文件,但是输入了一个跟小的值,还是报了异常,这是为什么?

测试日志如下

kafka_2.13-3.4.0$ bin/kafka-console-producer.sh --broker-list ip:port --topic test-segment

1
[2023-03-25 15:11:47,267] ERROR Error when sending message to topic test-segment with key: null, value: 1 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)
org.apache.kafka.common.errors.RecordBatchTooLargeException: The request included message batch larger than the configured segment size on the server.