领导人选举后,卡夫卡主题失去了所有副本

时间:2019-12-15 07:14:57

标签: apache-kafka

我在尝试产生kafka主题(从中消费)时得到了以下建议:

[2019-12-12 17:33:53,049] WARN [Producer clientId=console-producer] 1 partitions have leader brokers without a matching listener, including [wallet-V4_1_2-transactions-0] (org.apache.kafka.clients.NetworkClient)

在进一步研究中,我可以看到同步副本现在为0。 不幸的是,由于资源限制,分区和复制因子保持为1。

bin/kafka-topics --bootstrap-server 192.158.30.74:9092 --topic wallet-V4_1_2-transactions --describe
Topic:wallet-V4_1_2-transactions    PartitionCount:1    ReplicationFactor:1 Configs:
    Topic: wallet-V4_1_2-transactions   Partition: 0    Leader: none    Replicas: 2 Isr:

在细分目录中,我可以看到leader-epoch-checkpoint的另一个文件

root@8436f52ec04c:/var/lib/kafka/data/wallet-V4_1_2-transactions-0# ls -lart
total 656
-rwxrwxrwx   1 nobody nogroup 10485756 Dec  4 06:50 00000000000000003235.timeindex
-rwxrwxrwx   1 nobody nogroup       10 Dec  4 06:50 00000000000000003235.snapshot
-rwxrwxrwx   1 nobody nogroup       18 Dec 10 04:49 leader-epoch-checkpoint
drwxrwxrwx   2 nobody nogroup     4096 Dec 10 04:49 .
-rwxrwxrwx   1 nobody nogroup   636034 Dec 10 11:55 00000000000000003235.log
-rwxrwxrwx   1 nobody nogroup 10485760 Dec 10 11:55 00000000000000003235.index
drwxrwxrwx 106 nobody nogroup    12288 Dec 15 06:22 ..

here所述,消费者/生产者不应受到此影响。 其他问题已从Leader失败中恢复,我可以对其进行查询。

但是,该主题仍然显示错误:

[2019-12-15 09:54:12,303] WARN [Consumer clientId=consumer-1, groupId=console-consumer-83858] 1 partitions have leader brokers without a matching listener, including [wallet-V4_1_2-transactions-0] (org.apache.kafka.clients.NetworkClient)

如何从kafka中恢复已发布的消息并保留此主题

0 个答案:

没有答案