简体   繁体   English

将 Kafka 连接嵌入到 Ksqldb-server 时挂载(卷)不起作用

[英]Mount (Volumes) not working when embedding Kafka connect into Ksqldb-server

The "volumes" mapping does not seem to work when trying to embed Kafka connector in Ksqldb Server尝试在 Ksqldb 服务器中嵌入 Kafka 连接器时,“卷”映射似乎不起作用

Below is my docker file下面是我的 docker 文件

ksqldb-server:
        image: confluentinc/ksqldb-server:0.18.0
        hostname: ksqldb-server
        container_name: ksqldb-server
        depends_on:
          - broker
          - schema-registry
        ports:
          - "8088:8088"
        volumes:
          - "/usr/local/share/kafka/connectors/debezium-debezium-connector-mysql/lib:/usr/share/kafka/plugins/"
        environment:
          KSQL_LISTENERS: "http://0.0.0.0:8088"
          KSQL_BOOTSTRAP_SERVERS: "broker:9092"
          KSQL_KSQL_SCHEMA_REGISTRY_URL: "http://schema-registry:8081"
          KSQL_KSQL_LOGGING_PROCESSING_STREAM_AUTO_CREATE: "true"
          KSQL_KSQL_LOGGING_PROCESSING_TOPIC_AUTO_CREATE: "true"
          # Configuration to embed Kafka Connect support.
          KSQL_CONNECT_GROUP_ID: "ksql-connect-cluster"
          KSQL_CONNECT_BOOTSTRAP_SERVERS: "broker:9092"
          KSQL_CONNECT_KEY_CONVERTER: "org.apache.kafka.connect.storage.StringConverter"
          KSQL_CONNECT_VALUE_CONVERTER: "io.confluent.connect.avro.AvroConverter"
          KSQL_CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL: "http://schema-registry:8081"
          KSQL_CONNECT_CONFIG_STORAGE_TOPIC: "_ksql-connect-configs"
          KSQL_CONNECT_OFFSET_STORAGE_TOPIC: "_ksql-connect-offsets"
          KSQL_CONNECT_STATUS_STORAGE_TOPIC: "_ksql-connect-statuses"
          KSQL_CONNECT_CONFIG_STORAGE_REPLICATION_FACTOR: 1
          KSQL_CONNECT_OFFSET_STORAGE_REPLICATION_FACTOR: 1
          KSQL_CONNECT_STATUS_STORAGE_REPLICATION_FACTOR: 1
          KSQL_CONNECT_PLUGIN_PATH: "/usr/share/kafka/plugins"

I see the below error when I am trying to create a source using the connector当我尝试使用连接器创建源时看到以下错误

{ "error_code" : 500, "message" : "Failed to find any class that implements Connector and which name matches io.debezium.connector.mysql.MySqlConnector, available connectors are: ..........}" } { "error_code" : 500, "message" : "无法找到任何实现连接器且名称与 io.debezium.connector.mysql.MySqlConnector 匹配的类,可用的连接器是:.........}" }

I do have the required jar files installed locally in the folder "/usr/local/share/kafka/connectors/debezium-debezium-connector-mysql/lib" as mapped in the volumes in the docker file above.我确实在文件夹“/usr/local/share/kafka/connectors/debezium-debezium-connector-mysql/lib”中本地安装了所需的jar文件,如上面docker文件中的卷所映射。

What is it that I am missing?我错过了什么?

Much appreciated非常感激

After downloading a connector zip file extract their files into the plugin path in your worker configuration (eg connect-distributed.properties) using the plugin.path configuration property.下载连接器 zip 文件后,使用 plugin.path 配置属性将其文件解压缩到您的工作器配置中的插件路径(例如 connect-distributed.properties)。 As an example, let's assume you have downloaded the Debezium MySQL connector archive and extracted its contents to /kafka/connect/debezium-connector-mysql.例如,假设您已下载 Debezium MySQL 连接器存档并将其内容提取到 /kafka/connect/debezium-connector-mysql。 Then you'd specify the following in the worker config:然后你会在工作配置中指定以下内容:

plugin.path=/kafka/connect plugin.path=/kafka/connect

So in your case you mounting to an inner path, the connector plugin needs to be inside another folder and not directly the plugin path mount因此,在您安装到内部路径的情况下,连接器插件需要位于另一个文件夹中,而不是直接安装插件路径

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM