简体   繁体   English

卡夫卡卡在重新分配分区工具和进度

[英]Kafka stuck on reassign partitions tool and progress

Running the reassignment partitions tool, to expand the partitions over 5 brokers instead of 5. Kafka 2.1, on Docker. 运行重新分配分区工具,以在Docker上将分区扩展到5个代理而不是5个Kafka 2.1。

It gets to a point where one of the nodes behave erratically. 到了其中一个节点行为异常的地步。 The other (healthy) nodes begin to show these messages: 其他(健康)节点开始显示以下消息:

[2018-12-27 13:00:31,618] INFO [ReplicaFetcher replicaId=1, leaderId=3, fetcherId=0] Error sending fetch request (sessionId=48303608, epoch=226826) to node 3: java.io.IOException: Connection to 3 was disconnected before the response was read. (org.apache.kafka.clients.FetchSessionHandler)
[2018-12-27 13:00:31,620] WARN [ReplicaFetcher replicaId=1, leaderId=3, fetcherId=0] Error in response for fetch request (type=FetchRequest, replicaId=1, maxWait=500, minBytes=1, maxBytes=10485760, fetchData={impressions-35=(offset=3931626, logStartOffset=0, maxBytes=1048576, currentLeaderEpoch=Optional[29]), impressions-26=(offset=4273048, logStartOffset=0, maxBytes=1048576, currentLeaderEpoch=Optional[28]), impressions-86=(offset=3660830, logStartOffset=0, maxBytes=1048576, currentLeaderEpoch=Optional[28]), events-93=(offset=2535787, logStartOffset=0, maxBytes=1048576, currentLeaderEpoch=Optional[26]), impressions-53=(offset=3683354, logStartOffset=0, maxBytes=1048576, currentLeaderEpoch=Optional[28]), impressions-59=(offset=3696315, logStartOffset=0, maxBytes=1048576, currentLeaderEpoch=Optional[29]), impressions-11=(offset=3928338, logStartOffset=0, maxBytes=1048576, currentLeaderEpoch=Optional[28]), events-69=(offset=2510463, logStartOffset=0, maxBytes=1048576, currentLeaderEpoch=Optional[27]), events-72=(offset=2481181, logStartOffset=0, maxBytes=1048576, currentLeaderEpoch=Optional[28]), events-75=(offset=2462527, logStartOffset=0, maxBytes=1048576, currentLeaderEpoch=Optional[27]), events-126=(offset=2510344, logStartOffset=0, maxBytes=1048576, currentLeaderEpoch=Optional[27]), events-63=(offset=2515896, logStartOffset=0, maxBytes=1048576, currentLeaderEpoch=Optional[27])}, isolationLevel=READ_UNCOMMITTED, toForget=, metadata=(sessionId=48303608, epoch=226826)) (kafka.server.ReplicaFetcherThread)
java.io.IOException: Connection to 3 was disconnected before the response was read
    at org.apache.kafka.clients.NetworkClientUtils.sendAndReceive(NetworkClientUtils.java:97)
    at kafka.server.ReplicaFetcherBlockingSend.sendRequest(ReplicaFetcherBlockingSend.scala:97)
    at kafka.server.ReplicaFetcherThread.fetchFromLeader(ReplicaFetcherThread.scala:190)
    at kafka.server.AbstractFetcherThread.processFetchRequest(AbstractFetcherThread.scala:241)
    at kafka.server.AbstractFetcherThread.$anonfun$maybeFetch$3(AbstractFetcherThread.scala:130)
    at kafka.server.AbstractFetcherThread.$anonfun$maybeFetch$3$adapted(AbstractFetcherThread.scala:129)
    at scala.Option.foreach(Option.scala:257)
    at kafka.server.AbstractFetcherThread.maybeFetch(AbstractFetcherThread.scala:129)
    at kafka.server.AbstractFetcherThread.doWork(AbstractFetcherThread.scala:111)
    at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:82)

15 minutes later, the healthy servers show the following messages: 15分钟后,运行状况良好的服务器将显示以下消息:

[2018-12-27 13:16:00,540] INFO [ReplicaFetcher replicaId=1, leaderId=3, fetcherId=0] Retrying leaderEpoch request for partition events-111 as the leader reported an error: UNKNOWN_SERVER_ERROR (kafka.server.ReplicaFetcherThread)

Later on we can see lots of these messages: 稍后,我们可以看到很多这样的消息:

[2018-12-27 17:20:21,132] WARN [ReplicaManager broker=1] While recording the replica LEO, the partition events-116 hasn't been created. (kafka.server.ReplicaManager)

among other sets of these, more common: 其中的一些更为常见:

[2018-12-27 17:20:21,138] WARN [ReplicaManager broker=1] Leader 1 failed to record follower 3's position 2517140 since the replica is not recognized to be one of the ass

igned replicas 1,4,6 for partition events-53. 点燃副本1,4,6进行分区事件53。 Empty records will be returned for this partition. 将为此分区返回空记录。 (kafka.server.ReplicaManager) (kafka.server.ReplicaManager)

The reassigned topic had 128 partitions among 3 servers. 重新分配的主题在3台服务器中有128个分区。 All in all, each server has around 2000 partitions. 总而言之,每个服务器大约有2000个分区。

Now reassignment is stuck for 6 hours, showing a stuck 41% partitions underreplicated. 现在,重新分配卡住了6个小时,显示卡住的41%分区复制不足。 It had replication 3, although it now has replication 5. I suppose this is part of how the rebalancing happens underneath, in order to increase these replicas and later drop those that are unwanted? 它具有复制3,尽管现在具有复制5。我想这是下面如何进行重新平衡的一部分,以便增加这些副本并在以后删除不需要的副本?

Node 3 is however showing these messages: 但是,节点3显示以下消息:

[2018-12-27 17:10:05,509] WARN [RequestSendThread controllerId=3] Controller 3 epoch 14 fails to send request (type=LeaderAndIsRequest, controllerId=3, controllerEpoch=14, partitionStates={events-125=PartitionState(controllerEpoch=14, leader=1, leaderEpoch=25, isr=3,1,2, zkVersion=57, replicas=1,6,2,3, isNew=false)}, liveLeaders=(172.31.10.35:9092 (id: 1 rack: eu-west-1c))) to broker 172.31.27.111:9092 (id: 3 rack: eu-west-1a). Reconnecting to broker. (kafka.controller.RequestSendThread)

So, something is wrong with the node "3" - how can I know what happened with it? 因此,节点“ 3”出了点问题-我怎么知道它发生了什么?

It has happened the two times we tried reassigning partitions in two topics of the same partition size. 我们两次尝试在相同分区大小的两个主题中重新分配分区,这已经发生了两次。 In the previous case, we brought up another machine as a new broker (restarting container didn't help) with the same Id and it recovered. 在前一种情况下,我们以相同的ID启用了另一台计算机作为新代理(重新启动容器无济于事),并且计算机恢复了。 But, how can this be avoided to happen? 但是,如何避免这种情况发生呢?

What can be the root cause? 根本原因是什么?

Some time past since this was written. 自从写这篇文章以来已经过去了一段时间。 However if it helps anyone, I think the settings changes that helped were: to increase zookeeper.session.timeout.ms , zookeeper.connection.timeout.ms , and replica.lag.time.max.ms in our case to 60000 . 但是,如果对任何人replica.lag.time.max.ms用,我认为设置更改会有所帮助:在我们的案例中,将zookeeper.session.timeout.mszookeeper.connection.timeout.msreplica.lag.time.max.ms增加到60000

Since then it has not happened again. 从那以后它再没有发生过。 The idea behind is that at some point one of the brokers loses ZK session, and that creates misconnection between the brokers that think the broker is still alive and ZK who thinks it is not. 背后的想法是,某个经纪人在某个时刻失去了ZK会话,并在认为该经纪人还活着的经纪人与认为不是经纪人的ZK之间造成了误连接。 For some reason this doesn't ever get cleaned . 由于某种原因,它永远不会清洗 Increasing these settings allow for longer session stickiness times. 增加这些设置可以延长会话的粘性时间。 Beware, it also would take longer to expire brokers that are genuinely dead. 提防,要使真正死亡的经纪人到期也需要更长的时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 卡夫卡重新分配分区工作卡在待定状态 - kafka reassign-partitions job stuck in pending kafka 领导者不可用 - kafka-reassign-partitions - kafka leader unavailable - kafka-reassign-partitions 我可以在 Kafka 上自动重新分配分区吗? - Can I auto-reassign partitions on Kafka? kafka-reassign-partitions --generate for topic __commit_offsets 给了我奇怪的结果:分区副本只在一个代理上 - kafka-reassign-partitions --generate for topic __commit_offsets gives me strange result: partition replica only on one broker anyway 在 Kafka Streams 中重新平衡期间重建状态存储之前,分区处理卡住 - Partitions processing stuck until state store is rebuilt during rebalancing in Kafka Streams 无法重新分配Kafka主题分区 - Cannot reassign kafka topic partition 中止kafka重新分配分区行动 - aborting kafka reassign partition action 当我们运行kafka-reassign-partition工具平衡代理之间的分区时,生产者和消费者是否可以写入和读取数据? - Does producers and consumers can write and read data, while we run kafka-reassign-partition tool to balance partition across brokers? 卡夫卡 - 主题与分区与消费者 - Kafka - Topic & Partitions & Consumer Kafka 会允许“非平衡”分区吗? - Will Kafka allow “unballanced” partitions?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM