繁体   English   中英

为什么 kafka 集群会出现错误“活动代理的数量 '0' 不符合所需的复制因子”?

[英]Why kafka cluster did error "Number of alive brokers '0' does not meet the required replication factor"?

我有 2 个卡夫卡经纪人和 1 个动物园管理员。 经纪人配置:server.properties 文件:1 个经纪人:

auto.create.topics.enable=true
broker.id=1
delete.topic.enable=true
group.initial.rebalance.delay.ms=0
listeners=PLAINTEXT://5.1.2.3:9092
log.dirs=/opt/kafka_2.12-2.1.0/logs
log.retention.check.interval.ms=300000
log.retention.hours=168
log.segment.bytes=1073741824
max.message.bytes=105906176
message.max.bytes=105906176
num.io.threads=8
num.network.threads=3
num.partitions=10
num.recovery.threads.per.data.dir=1
offsets.topic.replication.factor=1
replica.fetch.max.bytes=105906176
socket.receive.buffer.bytes=102400
socket.request.max.bytes=105906176
socket.send.buffer.bytes=102400
transaction.state.log.min.isr=1
transaction.state.log.replication.factor=1
zookeeper.connect=5.1.3.6:2181
zookeeper.connection.timeout.ms=6000

2 经纪人:

auto.create.topics.enable=true
broker.id=2
delete.topic.enable=true
group.initial.rebalance.delay.ms=0
listeners=PLAINTEXT://18.4.6.6:9092
log.dirs=/opt/kafka_2.12-2.1.0/logs
log.retention.check.interval.ms=300000
log.retention.hours=168
log.segment.bytes=1073741824
max.message.bytes=105906176
message.max.bytes=105906176
num.io.threads=8
num.network.threads=3
num.partitions=10
num.recovery.threads.per.data.dir=1
offsets.topic.replication.factor=1
replica.fetch.max.bytes=105906176
socket.receive.buffer.bytes=102400
socket.request.max.bytes=105906176
socket.send.buffer.bytes=102400
transaction.state.log.min.isr=1
transaction.state.log.replication.factor=1
zookeeper.connect=5.1.3.6:2181
zookeeper.connection.timeout.ms=6000

如果我这样问动物园管理员:

回声转储 | 数控 Zook_IP 2181

我有:

SessionTracker dump:
Session Sets (3):
0 expire at Sun Jan 04 03:40:27 MSK 1970:
1 expire at Sun Jan 04 03:40:30 MSK 1970:
        0x1000bef9152000b
1 expire at Sun Jan 04 03:40:33 MSK 1970:
        0x1000147d4b40003
ephemeral nodes dump:
Sessions with Ephemerals (2):
0x1000147d4b40003:
        /controller
        /brokers/ids/2
0x1000bef9152000b:
        /brokers/ids/1

看起来不错,但不起作用:(。Zookeeper 看到 2 个代理,但在第一个 kafka 代理中我们有错误:

 ERROR [KafkaApi-1] Number of alive brokers '0' does not meet the required replication factor '1' for the offsets topic (configured via 'offsets.topic.replication.factor'). This error can be ignored if the cluster is starting up and not all brokers are up yet. (kafka.server.KafkaApis)

我们也将 kafka_exporter 用于普罗米修斯,他记录了这个错误:

Cannot get oldest offset of topic Some.TOPIC partition 9: kafka server: Request was for a topic or partition that does not exist on this broker." source="kafka_exporter.go:296

请帮忙? 我是不是配置错了

你的时钟在工作吗? 动物园管理员认为是 1970 年

Sun Jan 04 03:40:27 MSK 1970

您可能想查看日志的 rest 或查看 Kafka 和 Zookeeper 是否正在积极运行并且端口是否打开。

在您的第一条消息中,在启动一个新集群后您会看到这一点,所以这不是一个真正的错误

如果集群正在启动并且并非所有代理都已启动,则可以忽略此错误。 (kafka.server.KafkaApis)

但是,您显示的属性在完全不同的子网上有侦听器,并且您没有使用advertised.listeners

Kafka broker.id 更改可能会导致此问题。 清理zk下的kafka元数据,注意:kafka数据会丢失

在这种情况下,我收到此错误消息:

  • SSL 中的集群通话
  • 每个经纪人都是一个容器
  • 在所有代理中使用新密码更新了证书
  • 滚动更新

在第一次代理重新启动后,它会发送此错误消息,并且代理 controller 谈到“新代理已连接但密码验证失败”。

解决方案:

  1. 用旧密码设置新证书密码
  2. 一次向下然后向上整个集群
  3. (尚未测试)更改一个代理上的证书,重新启动它然后移动到下一个代理,直到您重新启动所有代理(以控制器结束)

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM