K8s 上的广告 kafka 连接休息监听器 [英] Advertised kafka connect rest listener on K8s
问题描述
我正在努力以分布式模式在 Kubernetes (DockerEE) 上设置 Kafka Connect.
目前我在三个相应的 k8s-pods 上有一个由三个工人组成的集群.
我面临的问题是我的员工很难相互沟通(至少我是这么认为的).
I am struggling to setup Kafka Connect on Kubernetes (DockerEE) in distributed mode.
Currently I have a cluster of three workers on three corresponding k8s-pods.
The problem that Im facing is that my workers are having a hard time communicating to each other (at least that is what I belive).
当我尝试启动连接器时,我得到:
When I try to start a connector I get:
{"error_code":409,"message":"Cannot complete request because of a conflicting operation (e.g. worker rebalance)"}
作为回应.令人费解的是,我并不总是得到这个错误响应.有时它会正常工作并且连接器会按预期启动.
in response. The puzzling thing is that I dont always get this error response. Sometimes it work and the connector is started as expected.
从我读到的内容来看,它可能归结为我配置为 CONNECT_REST_ADVERTISED_HOST_NAME 的内容.
From what Ive read it probably comes down to what I have configured as CONNECT_REST_ADVERTISED_HOST_NAME.
在 k8s 中运行时,作为广告地址放置的正确值是多少?
What is the correct value to put as advertised address when running in k8s?
BR
推荐答案
经过一番谷歌搜索后,我找到了一种将 pod-ip 动态分配为 CONNECT_REST_ADVERTISED_HOST_NAME 的方法.
After some googling I found a way to dynamically assign the pod-ip as CONNECT_REST_ADVERTISED_HOST_NAME.
- name: CONNECT_REST_ADVERTISED_HOST_NAME
valueFrom:
fieldRef:
fieldPath: status.podIP
这样问题似乎就消失了.
With this the problems seem to have vanished.
这篇关于K8s 上的广告 kafka 连接休息监听器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!