問題描述
我使用 Helm charts 在本地 Minikube 上安裝了 Kafka
我想連接 MySQL 和 Kafka,使用連接器之一(如 例如 Debezium MySQL CDC).在說明中,它說:
<塊引用>安裝連接器
使用 Confluent Hub 客戶端安裝這個連接器:
confluent-hub install debezium/debezium-connector-mysql:0.9.2
聽起來不錯,除了 1) 我不知道在哪個 pod 上運行此命令,2) 似乎沒有一個 pod 有可用的 confluent-hub 命令.
問題:
- confluent-hub 不是通過這些 Helm 圖表安裝的嗎?
- 我必須自己安裝 confluent-hub 嗎?
- 如果是這樣,我必須將它安裝在哪個 pod 上?
理想情況下,這應該作為 helm
腳本的一部分進行配置,但不幸的是,目前還沒有.解決此問題的一種方法是從 Confluent 的 Kafka Connect Docker 映像構(gòu)建一個新的 Docker.手動下載連接器并將內(nèi)容解壓縮到一個文件夾中.將其內(nèi)容復制到容器中的路徑.像下面這樣的東西.
Dockerfile 的內(nèi)容
FROM confluentinc/cp-kafka-connect:5.2.1復制<連接器目錄>/usr/share/java
/usr/share/java
是 Kafka Connect 尋找插件的默認位置.您還可以在 helm
安裝期間使用不同的位置并提供新位置 (plugin.path
).
構(gòu)建此映像并將其托管在可訪問的地方.您還必須在 helm
安裝期間提供/覆蓋圖像和標簽詳細信息.
Here> 是 values.yaml
文件的路徑.您可以在此處找到 image
和 plugin.path
值.
I have installed Kafka on a local Minikube by using the Helm charts https://github.com/confluentinc/cp-helm-charts following these instructions https://docs.confluent.io/current/installation/installing_cp/cp-helm-charts/docs/index.html like so:
helm install -f kafka_config.yaml confluentinc/cp-helm-charts --name kafka-home-delivery --namespace cust360
The kafka_config.yaml is almost identical to the default yaml, with the one exception being that I scaled it down to 1 server/broker instead of 3 (just because I'm trying to conserve resources on my local minikube; hopefully that's not relevant to my problem).
Also running on Minikube is a MySQL instance. Here's the output of kubectl get pods --namespace myNamespace
:
I want to connect MySQL and Kafka, using one of the connectors (like Debezium MySQL CDC, for instance). In the instructions, it says:
Install your connector
Use the Confluent Hub client to install this connector with:
confluent-hub install debezium/debezium-connector-mysql:0.9.2
Sounds good, except 1) I don't know which pod to run this command on, 2) None of the pods seem to have a confluent-hub command available.
Questions:
- Does confluent-hub not come installed via those Helm charts?
- Do I have to install confluent-hub myself?
- If so, which pod do I have to install it on?
Ideally this should be configurable as part of the helm
script, but unfortunately it is not as of now. One way to work around this is to build a new Docker from Confluent's Kafka Connect Docker image. Download the connector manually and extract the contents into a folder. Copy the contents of this to a path in the container. Something like below.
Contents of Dockerfile
FROM confluentinc/cp-kafka-connect:5.2.1
COPY <connector-directory> /usr/share/java
/usr/share/java
is the default location where Kafka Connect looks for plugins. You could also use different location and provide the new location (plugin.path
) during your helm
installation.
Build this image and host it somewhere accessible. You will also have to provide/override the image and tag details during the helm
installation.
Here is the path to the values.yaml
file. You can find the image
and plugin.path
values here.
這篇關(guān)于使用帶有 Helm 安裝的 Kafka/Confluent 的連接器的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!