网站建设资讯

NEWS

网站建设资讯

kafkaFailedtosendproducer-创新互联

线上环境出现的问题
版本:kafka-0.10.2.1
现象:
2017-11-29/14:45:02.937/CST wARN [kafka.utils.Logging$class.warn(Logging.scala:89)]:Failed to send producer request with correlation id 5 to broker 5 with data for partitions [mm-recommend-dev,2]
java.io.IOException: 断开的管道
at
sun.nio.ch.FileDispatcherImpl.writev0(Native Method)
at
sun.nio.ch.SocketDispatcher.writev(SocketDispatcher.java:51)
at
sun.nio.ch.IOUtil.write(IOUtil.java:148)
at
sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:524)
at java.nio.channels.SocketChannel.write(SocketChannel.java:493)
at kafka.network.BoundedByteBufferSend.writeTo(BoundedByteBufferSend.scala:56)
at kafka.network.Send$class.writeCompletely(Transmission.scala:75)
at kafka.network.BoundedByteBufferSend.writeCompletely(BoundedByteBufferSend.scala:26)
at kafka.network.BlockingChannel.send(BlockingChannel.scala:92)
at kafka.producer.SyncProducer.liftedTree1$1(SyncProducer.scala:72)
at kafka.producer.SyncProducer.kafka$producer$SyncProducer$$doSend(SyncProducer.scala:71)
at kafka.producer.SyncProducer$$anonfun$send$1$$anonfun$apply$mcV$sp$1.apply$mcV$sp(SyncProducer.scala:102)
at kafka.producer.SyncProducer$$anonfun$send$1$$anonfun$apply$mcV$sp$1.apply(SyncProducer.scala:102)
at kafka.producer.SyncProducer$$anonfun$send$1$$anonfun$apply$mcV$sp$1.apply(SyncProducer.scala:102)
at kafka.metrics.KafkaTimer.time(KafkaTimer.scala:33)
at kafka.producer.SyncProducer$$anonfun$send$1.apply$mcV$sp(SyncProducer.scala:101)

创新互联建站专注为客户提供全方位的互联网综合服务,包含不限于成都网站设计、成都网站制作、龙华网络推广、微信小程序开发、龙华网络营销、龙华企业策划、龙华品牌公关、搜索引擎seo、人物专访、企业宣传片、企业代运营等,从售前售中售后,我们都将竭诚为您服务,您的肯定,是我们大的嘉奖;创新互联建站为所有大学生创业者提供龙华建站搭建服务,24小时服务热线:13518219792,官方网址:www.cdcxhl.com

解决方法:
修改kafka broker的server.property的配置文件如下:
#加大每一条message的大值
message.max.bytes 默认为1000000 byte
调整后:
message.max.bytes=5252880
replica.fetch.max.bytes=6252880
request.timeout.ms=600000

[@zw ~]# kafka-topics.sh --alter --topic mm-recommend-dev --config max.message.bytes=5252880 --zookeeper ip:2181/kafka-0.10.2.1-test
WARNING: Altering topic configuration from this script has been deprecated and may be removed in future releases.
Going forward, please use kafka-configs.sh for this functionality
Updated config for topic "mm-recommend-dev".

新的方式
bin/kafka-configs.sh --zookeeper localhost:2181 --entity-type --alter --topic mm-recommend-dev --config max.message.bytes=5252880

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


本文标题:kafkaFailedtosendproducer-创新互联
转载源于:http://cdweb.net/article/deijii.html