无法找到任何实现连接器的类,哪个名称与FileStreamSource匹配
我遵循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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
只需添加
您的config/connect-standalone.properties文件即可。
just add
in your config/connect-standalone.properties file.
这个答案建立在 @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安装的defaultconnect-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 fileopt/homebrew/opt/kafka/libexec/config/connect-standalone.properties
, edited the new file to have an additional key-value pair ofplugin.path=/opt/homebrew/opt/kafka/libexec/libs
and then invoked theconnect-standalone
binary on myPATH
with that edited properties file as the first argument instead of my Kafka installation's defaultconnect-standalone.properties
file.对于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 myplugin.path
worked for me.看:
"(-(-(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:
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.
如果某人仍然遇到此问题,
fileStreamSourceConnector
和fileStreamSinkConnector
已从默认类中删除。用于在Kafka Connect中使用它们或分布式模式,或者需要明确添加,他们需要添加它们例如classPath =。/lib/connect-file-3.2.0.jar ./bin/connect-distributed.sh
。<请参阅官方文档。
If someone still having this problem,
FileStreamSourceConnector
andFileStreamSinkConnector
, have been removed from the default classpath.To use them in Kafka Connect standalone or distributed mode they need to be explicitly added, for exampleCLASSPATH=./lib/connect-file-3.2.0.jar ./bin/connect-distributed.sh
.See official documentation.
您确定在 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.