TIDB-kafka server: Message was too large, server rejected it to avoid allocation error

本文介绍了在TiDB中遇到的Kafka生产消息失败问题,原因在于大事务产生的binlog数据过大。解决办法是调整Kafka配置,如message.max.bytes、replica.fetch.max.bytes和fetch.message.max.bytes。

一、背景

使用drainer同步到kafka报错:

 ["fail to produce message to kafka, please check the state of kafka server"] [error="kafka: Failed to produce message to topic test-tidb: kafka server: Message was too large, server rejected it to avoid allocation error."]

二、解决

报错原因: 如果在 TiDB 中执行了大事务,则生成的 binlog 数据会比较大,可能超过了 Kafka 的消息大小限制。

解决方法: 需要调整 Kafka 集群的配置参数,如下所示。

message.max.bytes=1073741824
replica.fetch.max.bytes=1073741824
fetch.message.max.bytes=1073741824
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值