无法找到任何实现连接器的类,哪个名称与FileStreamSource匹配

发布于 2025-02-08 12:21:12 字数 3107 浏览 3 评论 0原文

我遵循Kafka快速入门指南。不过,我被卡在第6步中,将数据导入/导出您的数据作为事件流...

https:// kafka.apache.org/documentation/

错误表明kafka找不到连接器。我已经以多种方式将其添加到Connect-StandalOne.properties文件中。这就是我目前的方式。

plugin.path=/home/ben/kafka/kafka_2.12-3.2.0/lib/connect-file-3.2.0.jar

我还尝试仅指向Libs文件夹。

我停止了服务和服务器,并根据指南指示重新启动它们。然后,我尝试启动两个读写到文件的连接器。

bin/connect-standalone.sh config/connect-standalone.properties config/connect-file-source.properties config/connect-file-sink.properties

但这不会启动,并给我这个错误。

[2022-06-18 18:06:16,006] ERROR Failed to create job for config/connect-file-source.properties (org.apache.kafka.connect.cli.ConnectStandalone:107)
[2022-06-18 18:06:16,020] ERROR Stopping after connector error (org.apache.kafka.connect.cli.ConnectStandalone:117)
java.util.concurrent.ExecutionException: org.apache.kafka.connect.errors.ConnectException: Failed to find any class that implements Connector and which name matches FileStreamSource, available connectors are: PluginDesc{klass=class org.apache.kafka.connect.mirror.MirrorCheckpointConnector, name='org.apache.kafka.connect.mirror.MirrorCheckpointConnector', version='3.2.0', encodedVersion=3.2.0, type=source, typeName='source', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.mirror.MirrorHeartbeatConnector, name='org.apache.kafka.connect.mirror.MirrorHeartbeatConnector', version='3.2.0', encodedVersion=3.2.0, type=source, typeName='source', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.mirror.MirrorSourceConnector, name='org.apache.kafka.connect.mirror.MirrorSourceConnector', version='3.2.0', encodedVersion=3.2.0, type=source, typeName='source', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.tools.MockSinkConnector, name='org.apache.kafka.connect.tools.MockSinkConnector', version='3.2.0', encodedVersion=3.2.0, type=sink, typeName='sink', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.tools.MockSourceConnector, name='org.apache.kafka.connect.tools.MockSourceConnector', version='3.2.0', encodedVersion=3.2.0, type=source, typeName='source', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.tools.SchemaSourceConnector, name='org.apache.kafka.connect.tools.SchemaSourceConnector', version='3.2.0', encodedVersion=3.2.0, type=source, typeName='source', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.tools.VerifiableSinkConnector, name='org.apache.kafka.connect.tools.VerifiableSinkConnector', version='3.2.0', encodedVersion=3.2.0, type=sink, typeName='sink', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.tools.VerifiableSourceConnector, name='org.apache.kafka.connect.tools.VerifiableSourceConnector', version='3.2.0', encodedVersion=3.2.0, type=source, typeName='source', location='classpath'}

因此,似乎我没有正确地将属性指向连接器,尽管在我尝试的各种方式中,我还尝试了指南指示的相对路径。

这是运行Java 11的新型Ubuntu安装。我在这里缺少什么?

I following the Kafka quick start guide. I'm stuck as step 6 though, Import/Export your data as streams of Events...

https://kafka.apache.org/documentation/

The error indicates that Kafka can't find the connector. I've added it to the connect-standalone.properties file in a variety of ways. Here is how I currently have it.

plugin.path=/home/ben/kafka/kafka_2.12-3.2.0/lib/connect-file-3.2.0.jar

I also tried pointing only to the libs folder.

I stopped the services and server, and restarted them as the guide instructs. Then I try to start the two connectors which read and write to the files.

bin/connect-standalone.sh config/connect-standalone.properties config/connect-file-source.properties config/connect-file-sink.properties

But it won't start, and gives me this error.

[2022-06-18 18:06:16,006] ERROR Failed to create job for config/connect-file-source.properties (org.apache.kafka.connect.cli.ConnectStandalone:107)
[2022-06-18 18:06:16,020] ERROR Stopping after connector error (org.apache.kafka.connect.cli.ConnectStandalone:117)
java.util.concurrent.ExecutionException: org.apache.kafka.connect.errors.ConnectException: Failed to find any class that implements Connector and which name matches FileStreamSource, available connectors are: PluginDesc{klass=class org.apache.kafka.connect.mirror.MirrorCheckpointConnector, name='org.apache.kafka.connect.mirror.MirrorCheckpointConnector', version='3.2.0', encodedVersion=3.2.0, type=source, typeName='source', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.mirror.MirrorHeartbeatConnector, name='org.apache.kafka.connect.mirror.MirrorHeartbeatConnector', version='3.2.0', encodedVersion=3.2.0, type=source, typeName='source', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.mirror.MirrorSourceConnector, name='org.apache.kafka.connect.mirror.MirrorSourceConnector', version='3.2.0', encodedVersion=3.2.0, type=source, typeName='source', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.tools.MockSinkConnector, name='org.apache.kafka.connect.tools.MockSinkConnector', version='3.2.0', encodedVersion=3.2.0, type=sink, typeName='sink', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.tools.MockSourceConnector, name='org.apache.kafka.connect.tools.MockSourceConnector', version='3.2.0', encodedVersion=3.2.0, type=source, typeName='source', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.tools.SchemaSourceConnector, name='org.apache.kafka.connect.tools.SchemaSourceConnector', version='3.2.0', encodedVersion=3.2.0, type=source, typeName='source', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.tools.VerifiableSinkConnector, name='org.apache.kafka.connect.tools.VerifiableSinkConnector', version='3.2.0', encodedVersion=3.2.0, type=sink, typeName='sink', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.tools.VerifiableSourceConnector, name='org.apache.kafka.connect.tools.VerifiableSourceConnector', version='3.2.0', encodedVersion=3.2.0, type=source, typeName='source', location='classpath'}

So it seems I'm not pointing the properties to the connector correctly, although, among the variety of ways I'd tried, I also tried the relative path the guide instructs.

This is a new Ubuntu installation running Java 11. What am I missing here?

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

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

发布评论

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

评论(6

云柯 2025-02-15 12:21:12

只需添加

plugin.path=libs/connect-file-3.4.0.jar

您的config/connect-standalone.properties文件即可。

just add

plugin.path=libs/connect-file-3.4.0.jar

in your config/connect-standalone.properties file.

千鲤 2025-02-15 12:21:12

这个答案建立在 @John的答案中,以通过通过自制的Kafka安装来为在Macos Ventura上面对此问题的人提供参考。对于上下文,我在尝试运行 kafka of Action 第3章的连接器示例时遇到了此错误。为了解决此问题,我制作了文件opt/homebrew/opt/kafka/libexec/config/config/connect-stance-antalone.properties ,编辑了新文件以具有附加的键值价值Plugin.path =/opt/homebrew/opt/opt/kafka/libexec/libs,然后在我的path上调用connect> connect> connect-contract-standalone二进制使用该编辑的属性文件作为第一个参数,而不是我的kafka安装的default connect-standalone.properties文件。

This answer builds off @John's answer to provide a reference for those facing this issue on macOS Ventura with a Kafka installation done through Homebrew. For context, I encountered this error when trying to run a FileStreamSource connector example from Chapter 3 of Kafka in Action. In order to solve this issue, I made a copy of the file opt/homebrew/opt/kafka/libexec/config/connect-standalone.properties, edited the new file to have an additional key-value pair of plugin.path=/opt/homebrew/opt/kafka/libexec/libs and then invoked the connect-standalone binary on my PATH with that edited properties file as the first argument instead of my Kafka installation's default connect-standalone.properties file.

尤怨 2025-02-15 12:21:12

对于Confluent-7.2.2,FileStreamSource连接器位于文件夹/share/fileStream-connectors中。将其添加到我的plugin.path为我工作。

For confluent-7.2.2 the FileStreamSource connector is in the folder /share/filestream-connectors. Adding that to my plugin.path worked for me.

一场春暖 2025-02-15 12:21:12

看:

./ bin/kafka-run-class.sh:regex =“( - (测试| test | test-sources | src | scaladoc | javadoc)。

"(-(-(test|-test|-test-sources| src| src| src| scaladoc| javadoc).jarmjar.jar.jar.ascc.connect-file.jar.y.jar) t知道细节,但是在类路径中排除了连接文件。简单地编辑kafka-run-class.sh为我完成了技巧。

Look at:

./bin/kafka-run-class.sh:regex="(-(test|test-sources|src|scaladoc|javadoc).jar|jar.asc|connect-file.*.jar)$"

I don't know the details, but connect-file is excluded in the class path. Simply editing kafka-run-class.sh did the trick for me.

念﹏祤嫣 2025-02-15 12:21:12

如果某人仍然遇到此问题,fileStreamSourceConnectorfileStreamSinkConnector已从默认类中删除。用于在Kafka Connect中使用它们或分布式模式,或者需要明确添加,他们需要添加它们例如
classPath =。/lib/connect-file-3.2.0.jar ./bin/connect-distributed.sh

<请参阅官方文档

If someone still having this problem, FileStreamSourceConnector and FileStreamSinkConnector, have been removed from the default classpath.To use them in Kafka Connect standalone or distributed mode they need to be explicitly added, for example
CLASSPATH=./lib/connect-file-3.2.0.jar ./bin/connect-distributed.sh.

See official documentation.

陌上青苔 2025-02-15 12:21:12

您确定在 config/connect-standalone.properties 中指定正确的绝对路径吗?这是我的配置:plugin.path =/user/user-name/kafka_2.13-3.7.1/libs/connect/connect-file-3.7.1.jar。请注意,在接收器和源文件中,为了获得最佳实践,请使用绝对路径。

Are you sure that you specify the correct absolute path in the config/connect-standalone.properties? Here is my configuration: plugin.path=/Users/user-name/kafka_2.13-3.7.1/libs/connect-file-3.7.1.jar. Notice that in the sink and source file, for best practice, use absolute path.

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