【问题标题】:Scaling up a Kafka streams application deployment in Kubernetes using helm使用 helm 在 Kubernetes 中扩展 Kafka 流应用程序部署
【发布时间】:2021-10-24 11:35:43
【问题描述】:

我们有一个基于 Java 的 kafka 流应用程序,它使用 helm 图表部署到 kubernetes 集群。为了扩大部署,我们使用副本集的 Kubernetes 选项,它将运行应用程序的多个实例。但是运行应用程序的多个实例会导致 Pod 崩溃,并出现以下错误。

Exception in thread "****-StreamThread-1" org.apache.kafka.common.errors.FencedInstanceIdException: The broker rejected this static consumer since another consumer with the same group.instance.id has registered with a different member.id.

【问题讨论】:

  • 如果您可以显示应用程序的StreamsConfig/client 属性将会很有用

标签: kubernetes apache-kafka kubernetes-helm apache-kafka-streams kubernetes-pod


【解决方案1】:

您的配置中有太多是静态的。 根据文档:

group.instance.id
A unique identifier of the consumer instance provided by the end user. Only non-empty strings are permitted. If set, the consumer is treated as a static member, which means that only one instance with this ID is allowed in the consumer group at any time.

看起来您的应用程序的不同实例应该有不同的 group.instance.id。

最后,它与 k8、helm 或任何东西无关 - 您应该能够通过在本地计算机上启动应用程序的多个实例来复制它,所有这些实例都指向同一个 Kafka 安装。

【讨论】:

  • 非常感谢@AdamKotwasinski group.instance.id 是硬编码的,删除它对我们有用。我们能够运行多个应用实例。
猜你喜欢
  • 2021-08-29
  • 2018-09-04
  • 2018-11-08
  • 2017-06-10
  • 1970-01-01
  • 1970-01-01
  • 2018-08-17
  • 2019-10-20
  • 2022-06-22
相关资源
最近更新 更多