我试图运行confluent的docker映像来初始化带有debezium mysql连接器的连接服务,但在运行docker后未能获取加载的类。
docker命令
docker run -d \
--name=kafka-connect \
--net=host \
-e CONNECT_BOOTSTRAP_SERVERS="b-2.<bootstrap_server>.us-east-1.amazonaws.com:9092,b-3.<bootstrap_server>.us-east-1.amazonaws.com:9092,b-1.<bootstrap_server>.us-east-1.amazonaws.com:9092" \
-e CONNECT_REST_PORT=8083 \
-e CONNECT_PLUGIN_PATH="/usr/share/java,/tmp/connectors" \
-e CONNECT_GROUP_ID="quickstart" \
-e CONNECT_CONFIG_STORAGE_TOPIC="quick-config" \
-e CONNECT_OFFSET_STORAGE_TOPIC="quick-offsets" \
-e CONNECT_STATUS_STORAGE_TOPIC="quick-status" \
-e CONNECT_KEY_CONVERTER="org.apache.kafka.connect.json.JsonConverter" \
-e CONNECT_VALUE_CONVERTER="org.apache.kafka.connect.json.JsonConverter" \
-e CONNECT_INTERNAL_KEY_CONVERTER="org.apache.kafka.connect.json.JsonConverter" \
-e CONNECT_INTERNAL_VALUE_CONVERTER="org.apache.kafka.connect.json.JsonConverter" \
-e CONNECT_REST_ADVERTISED_HOST_NAME="ec2-<public_ip>.compute-1.amazonaws.com" \
-v /opt/connectors:/tmp/connectors \
confluentinc/cp-kafka-connect:3.1.2
卷(-v)中使用的我的示例目录文件如下:
ubuntu@ip-<hostname>:/opt/connectors$ ls
debezium-connect-jdbc
下面的命令测试debeziummysql驱动类是否加载
curl -s http://ec2-<public_ip>.compute-1.amazonaws.com:8083/connector-plugins | jq .
在运行上述命令之后,我没有看到下面提到的debeziummysql连接器类
io.debezium.connector.mysql.MySqlConnector
1条答案
按热度按时间epggiuax1#
您的问题是Kafka连接版本太旧:
confluentinc/cp-kafka-connect:3.1.2
随附0.10.1.1版本,但connect中的类加载隔离仅在0.11.0中实现。请使用更新的图像。