使用Kafka时,我间歇性地出现两个与网络相关的错误。
1. Error in fetch kafka.server.replicafetcherthread$fetchrequest connection to broker was disconnected before the reponse was read
2. Error in fetch kafka.server.replicafetcherthread$fetchrequest Connection to broker1 (id: 1 rack: null) failed
[配置环境]
Brokers: 5 / server.properties: "kafka_manager_heap_s=1g", "kafka_manager_heap_x=1g", "offsets.commit.required.acks=1","offsets.commit.timeout.ms=5000", Most settings are the default.
Zookeepers: 3
Servers: 5
Kafka:0.10.1.2
Zookeeper: 3.4.6
这两种错误都是由于网络通信中断造成的。
如果出现这些错误,kafka将多次扩展或收缩isr分区。
expanding-ex) INFO Partition [my-topic,7] on broker 1: Expanding ISR for partition [my-topic,7] from 1,2 to 1,2,3
shrinking-ex) INFO Partition [my-topic,7] on broker 1: Shrinking ISR for partition [my-topic,7] from 1,2,3 to 1,2
我知道这些错误是由网络问题引起的,但我不确定为什么会发生网络中断。
如果此网络断开持续存在,我将得到以下附加错误: Error when handling request(topics=null} java.lang.OutOfMemoryError: Java heap space
我想知道是什么原因导致这些,我如何才能改善这一点?
1条答案
按热度按时间kxe2p93d1#
网络错误告诉您其中一个代理没有运行,这意味着它无法连接到它。根据经验,您可以分配的最小堆大小是2gb。