gpt4 book ai didi

mysql - Kafka Mysql Connectorplugin.path配置

转载 作者:行者123 更新时间:2023-11-29 09:29:49 25 4
gpt4 key购买 nike

我正在尝试将 mysqlkafka 连接。我已经下载了 debezium-debezium-connector-mysql

enter image description here

这是我的connect-standalone.properties:

# These are defaults. This file just demonstrates how to override some settings.
bootstrap.servers=localhost:9092

# The converters specify the format of data in Kafka and how to translate it into Connect data. Every Connect user will
# need to configure these based on the format they want their data in when loaded from or stored into Kafka
key.converter=org.apache.kafka.connect.json.JsonConverter
value.converter=org.apache.kafka.connect.json.JsonConverter
# Converter-specific settings can be passed in by prefixing the Converter's setting with the converter we want to apply
# it to
key.converter.schemas.enable=true
value.converter.schemas.enable=true

offset.storage.file.filename=/tmp/connect.offsets
# Flush much faster than normal, which is useful for testing/debugging
offset.flush.interval.ms=10000

# Set to a list of filesystem paths separated by commas (,) to enable class loading isolation for plugins
# (connectors, converters, transformations). The list should consist of top level directories that include
# any combination of:
# a) directories immediately containing jars with plugins and their dependencies
# b) uber-jars with plugins and their dependencies
# c) directories immediately containing the package directory structure of classes of plugins and their dependencies
# Note: symlinks will be followed to discover dependencies or plugins.
# Examples:
# plugin.path=/usr/local/share/java,/usr/local/share/kafka/plugins,/opt/connectors,
plugin.path=/home/ec2-user/share/confluent-hub-components/debezium-debezium-connector-mysql/lib

我的test.config:

{
"name": "mysql-source-demo-customers",
"config": {
"connector.class": "io.debezium.connector.mysql.MySqlConnector",
"database.hostname": "localhost",
"database.port": "3306",
"database.user": "root",
"database.password": "dsm1234",
"database.server.id": "42",
"database.server.name": "asgard",
"table.whitelist": "demo.customers",
"database.history.kafka.bootstrap.servers": "localhost:9092",
"database.history.kafka.topic": "dbhistory.demo" ,
"include.schema.changes": "true",
"transforms": "unwrap,InsertTopic,InsertSourceDetails",
"transforms.unwrap.type": "io.debezium.transforms.UnwrapFromEnvelope",
"transforms.InsertTopic.type":"org.apache.kafka.connect.transforms.InsertField$Value",
"transforms.InsertTopic.topic.field":"messagetopic",
"transforms.InsertSourceDetails.type":"org.apache.kafka.connect.transforms.InsertField$Value",
"transforms.InsertSourceDetails.static.field":"messagesource",
"transforms.InsertSourceDetails.static.value":"Debezium CDC from MySQL on asgard"
}
}

当我运行bin/connect-standalone.sh config/connect-standalone.properties test.config时,

我收到错误:

[2019-11-19 09:10:45,146] INFO Scanning for plugin classes. This might take a moment ... (org.apache.kafka.connect.cli.ConnectStandalone:78) [2019-11-19 09:10:45,170] INFO Loading plugin from: /home/ec2-user/share/confluent-hub-components/debezium-debezium-connector-mysql/lib/mysql-binlog-connector-java-0.19.1.jar (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:222) [2019-11-19 09:10:45,291] INFO Registered loader: PluginClassLoader{pluginLocation=file:/home/ec2-user/share/confluent-hub-components/debezium-debezium-connector-mysql/lib/mysql-binlog-connector-java-0.19.1.jar} (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:245) [2019-11-19 09:10:45,292] INFO Added plugin 'org.apache.kafka.connect.connector.policy.AllConnectorClientConfigOverridePolicy' (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:174) [2019-11-19 09:10:45,292] INFO Added plugin 'org.apache.kafka.connect.connector.policy.PrincipalConnectorClientConfigOverridePolicy' (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:174) [2019-11-19 09:10:45,292] INFO Added plugin 'org.apache.kafka.connect.connector.policy.NoneConnectorClientConfigOverridePolicy' (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:174) [2019-11-19 09:10:45,293] INFO Loading plugin from: /home/ec2-user/share/confluent-hub-components/debezium-debezium-connector-mysql/lib/debezium-connector-mysql-0.10.0.Final.jar (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:222) [2019-11-19 09:10:45,324] ERROR Stopping due to error (org.apache.kafka.connect.cli.ConnectStandalone:130) java.lang.NoClassDefFoundError: io/debezium/util/IoUtil at io.debezium.connector.mysql.Module.(Module.java:19) at io.debezium.connector.mysql.MySqlConnector.version(MySqlConnector.java:47) at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.versionFor(DelegatingClassLoader.java:350) at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.versionFor(DelegatingClassLoader.java:355) at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.getPluginDesc(DelegatingClassLoader.java:331) at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.scanPluginPath(DelegatingClassLoader.java:311) at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.scanUrlsAndAddPlugins(DelegatingClassLoader.java:244) at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.registerPlugin(DelegatingClassLoader.java:236) at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.initPluginLoader(DelegatingClassLoader.java:205) at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.initLoaders(DelegatingClassLoader.java:182) at org.apache.kafka.connect.runtime.isolation.Plugins.(Plugins.java:61) at org.apache.kafka.connect.cli.ConnectStandalone.main(ConnectStandalone.java:79) Caused by: java.lang.ClassNotFoundException: io.debezium.util.IoUtil at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:418) at org.apache.kafka.connect.runtime.isolation.PluginClassLoader.loadClass(PluginClassLoader.java:104) at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ... 12 more

通过查看日志,io/debezium/util/IoUtil 似乎有问题。
(我在 google 和 stackoverflow 上搜索了插件路径。我在 Stackoverflow 中发现了类似的问题并关注了它,但仍然不起作用。)

我错过了什么?

最佳答案

如果您使用 Confluence Hub 客户端安装连接器,则不需要编辑插件路径。它是递归扫描的,因此只需 /home/ec2-user/share/confluence-hub-components 就可以工作。

旁注:我建议将插件存储在 ec2-user 主文件夹以外的位置,因为此类长时间运行的进程通常作为其自己的、有限的用户帐户运行

关于mysql - Kafka Mysql Connectorplugin.path配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58930386/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com