尝试使用 Docker 通过 jar 文件安装 Kafka Connect 连接器,安装出现错误

发布于 2025-01-11 23:30:48 字数 1128 浏览 0 评论 0原文

我正在使用 docker-compose 和 Dockerfile 来安装连接器。我已成功从 Confluence Hub 安装连接器,但未能成功安装我自己的 jar 文件。

这就是我所做的:

  1. 去了 https://search.maven.org/artifact/io.aiven/aiven-kafka-connect-gcs/0.7.0/jar 并在右上角按“下载”和单击“jar”
  2. 将此文件放在与我的 Dockerfile 相同的文件夹中
  3. 运行我的 Dockerfile:

ENV CONNECT_PLUGIN_PATH="/usr/share/java,/usr/share/confluent-hub-components"

USER root
COPY --chown=appuser:appuser aiven-kafka-connect-gcs-0.7.0.jar /usr/share/confluent-hub-components
USER appuser

RUN confluent-hub install --no-prompt aiven/kafka-connect-gcs:0.7.0

我还尝试了各种 confluence-hub install 命令,包括:

RUN confluent-hub install --no-prompt aiven-kafka-connect-gcs:0.7.0
RUN confluent-hub install --no-prompt confluent-hub-components/aiven-kafka-connect-gcs-0.7.0.jar
RUN confluent-hub install --no-prompt aiven-kafka-connect-gcs-0.7.0.jar

全部无济于事。我确实尝试过其他目录,例如 /etc/kafka-connect/jars ,但我一直遇到同样的问题。

我做错了什么?句法?缺少额外的安装命令?还有别的事吗?

I have am using docker-compose along with a Dockerfile to install a connector. I have been successful in installing connectors from Confluent Hub, but not my own jar files.

Here is what I did:

  1. Went to https://search.maven.org/artifact/io.aiven/aiven-kafka-connect-gcs/0.7.0/jar and in the upper right corner, pressed Downloads and clicked on "jar"
  2. Placed this file in the same folder as my Dockerfile
  3. Ran my Dockerfile:

ENV CONNECT_PLUGIN_PATH="/usr/share/java,/usr/share/confluent-hub-components"

USER root
COPY --chown=appuser:appuser aiven-kafka-connect-gcs-0.7.0.jar /usr/share/confluent-hub-components
USER appuser

RUN confluent-hub install --no-prompt aiven/kafka-connect-gcs:0.7.0

I have also tried various confluent-hub install commands, including:

RUN confluent-hub install --no-prompt aiven-kafka-connect-gcs:0.7.0
RUN confluent-hub install --no-prompt confluent-hub-components/aiven-kafka-connect-gcs-0.7.0.jar
RUN confluent-hub install --no-prompt aiven-kafka-connect-gcs-0.7.0.jar

all to no avail. I did try other directories like /etc/kafka-connect/jars and I just keep getting the same issue.

What am I doing wrong? Syntax? Missing additional mounting commands? Something else?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

初熏 2025-01-18 23:30:48

confluence-hub 不会“安装”本地 JAR 文件

默认情况下,它使用其参数对 Confluence Hub 网站进行 HTTP 查找并返回相应的响应。如果它是一个有效的连接器,它会将其提取到插件路径,否则,您将收到错误

如果您给它一个本地 ZIP,那就可以了

从 Confluence Hub 下载的本地 ZIP 文件的路径

confluent-hub doesn't "install" local JAR files

By default, it uses its arguments to do an HTTP lookup against the Confluent Hub website and return the according response. If it's a valid connector, it'll extract it to the plugin path, otherwise, you'll get an error

If you give it a local ZIP, that will work

path to a local ZIP file that was downloaded from Confluent Hub

春花秋月 2025-01-18 23:30:48

我就是这样做的:

RUN wget -O /set/your/path/here/<connector name here>.tar https://url-of-connector-here/<connector name and version here>.tar
RUN tar -xvf /set/your/path/here/<connector name here>.tar --directory /path/to/connect/plugins/here/

而且成功了。

This is how I did it:

RUN wget -O /set/your/path/here/<connector name here>.tar https://url-of-connector-here/<connector name and version here>.tar
RUN tar -xvf /set/your/path/here/<connector name here>.tar --directory /path/to/connect/plugins/here/

and it worked.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文