在K8s上投放广告的Kafka Connect休息监听器 [英] 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 Connect休息监听器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!