尝试使用 Docker 通过 jar 文件安装 Kafka Connect 连接器,安装出现错误
我正在使用 docker-compose 和 Dockerfile 来安装连接器。我已成功从 Confluence Hub 安装连接器,但未能成功安装我自己的 jar 文件。
这就是我所做的:
- 去了 https://search.maven.org/artifact/io.aiven/aiven-kafka-connect-gcs/0.7.0/jar 并在右上角按“下载”和单击“jar”
- 将此文件放在与我的 Dockerfile 相同的文件夹中
- 运行我的 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:
- 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"
- Placed this file in the same folder as my Dockerfile
- 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
confluence-hub
不会“安装”本地 JAR 文件默认情况下,它使用其参数对 Confluence Hub 网站进行 HTTP 查找并返回相应的响应。如果它是一个有效的连接器,它会将其提取到插件路径,否则,您将收到错误
如果您给它一个本地 ZIP,那就可以了
confluent-hub
doesn't "install" local JAR filesBy 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
我就是这样做的:
而且成功了。
This is how I did it:
and it worked.