遇到问题:
配置maxwell+kafka的时候遇到报错提示producer request的大小大于默认值,结合maxwell启动时候的打印初始参数可知是参数的问题

ERROR MaxwellKafkaProducer - The message is 1260501 bytes when serialized which is larger than the maximum request size you have configured with the max.request.size configuration.

参考kafka文档可知max.request.size默认值为1048576
解决办法:
1.

https://ask.csdn.net/questions/672334
看文章了解到可以修改kafka的server.properties、producer.properties、kafka-rest.properties这三个文件中的max.request.size参数。

max.request.size=104857600  #大小是自己的情况而定

我只修改了前两个文件中的参数(没找到kafka-rest.properties),但是依旧不生效
2.

https://www.yisu.com/zixun/55015.html

收到文章的启发,我猜测应该要修改的不(仅)是kafka的配置文件,还有maxwell的 config.properties。因为我是用的是docker部署的maxwell,镜像中只有 config.properties.examle,怎么修改都是没用的。必须自己新建一个文件 config.properties,并在其中加入

max.request.size = 104857600

然后启动的时候通过config参数指定这个配置文件

bin/maxwell --user='maxwell'     \
--password='123456' --host='xxx.xx.x.x' --producer=kafka  \   
--kafka.bootstrap.servers=xxx.xx.x.x:9092 \
--kafka_topic=maxwell --config config.properties

即可

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐