故障报告

1. 问题(故障)描述

kafkab报错

java.io.IOException: Connection to 2 was disconnected before the response was read
    at org.apache.kafka.clients.NetworkClientUtils.sendAndReceive(NetworkClientUtils.java:95)
    at kafka.server.ReplicaFetcherBlockingSend.sendRequest(ReplicaFetcherBlockingSend.scala:96)
    at kafka.server.ReplicaFetcherThread.fetch(ReplicaFetcherThread.scala:205)
    at kafka.server.ReplicaFetcherThread.fetch(ReplicaFetcherThread.scala:41)
    at kafka.server.AbstractFetcherThread.processFetchRequest(AbstractFetcherThread.scala:149)
    at kafka.server.AbstractFetcherThread.doWork(AbstractFetcherThread.scala:113)
    at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:64)
[2021-12-10 16:52:57,349] ERROR Uncaught exception in scheduled task 'PeriodicProducerExpirationCheck' (kafka.utils.KafkaScheduler)
java.lang.OutOfMemoryError: Java heap space
[2021-12-10 16:52:57,349] ERROR Uncaught exception in scheduled task 'kafka-recovery-point-checkpoint' (kafka.utils.KafkaScheduler)
java.lang.OutOfMemoryError: Java heap space
[2021-12-10 16:52:57,349] ERROR [Transaction Marker Channel Manager 1]: unhandled exception caught in InterBrokerSendThread (kafka.coordinator.transaction.TransactionMarkerChannelManager)

2. 问题(故障)原因

内存不足导致

3. 解决

kafka启动脚本中添加KAFKA_HEAP_OPTS参数(10G:指定内存10G,参考值):
bin/kafka-server-start.sh
export KAFKA_HEAP_OPTS=”-Xmx10G -Xms10G”

4. 参考

文档更新时间: 2022-08-18 22:36   作者:周风磊