您好,登錄后才能下訂單哦!
線上環境出現的問題
版本: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)
解決方法:
修改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
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。