kafka-connect 错误:无法找到或加载主类 [英] kafka-connect error: cannot find or load main class

查看:34
本文介绍了kafka-connect 错误:无法找到或加载主类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在按照官方文档实施kakf-connect 从文件中读取数据.

I am following the official docs to implement the kakf-connect to read data from a file.

我让 kafka 完美运行.生产者和消费者发送和接收消息.

I have kafka running perfectly. A producer and consumer sending and receiving messages.

但是,当我运行以下命令时:

However, when I run the following command:

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

我收到以下错误:

错误:无法找到或加载主类 org.apache.kafka.connect.cli.ConnectStandalone

Error: Could not find or load main class org.apache.kafka.connect.cli.ConnectStandalone

我交叉检查,我有文件 ConnectStandalone 这里connect/runtime/src/main/java/org/apache/kafka/connect/cli/ConnectStandalone.

I crossed checked and I have the file ConnectStandalone here connect/runtime/src/main/java/org/apache/kafka/connect/cli/ConnectStandalone.

我的connect-file-source.properties如下:

name=local-file-source
connector.class=org.apache.kafka.connect.file.FileStreamSourceConnector
tasks.max=1
file=test.txt
topic=spark-kafka

有什么遗漏吗?我应该怎么做才能摆脱这个错误?

Is there something missing? What should I do to get rid of this error?

推荐答案

所以我对 Java 一窍不通我认为问题在于 kafka-connect 没有包含在 kafka 提供的 tarball 中.

So being fairly java ignorant I think that the problem is that kafka-connect isn't included in the tarballs that kafka provides.

我转而使用 confluent 平台,并且使用 tarball 连接效果很好:

I instead switched to using the confluent platform, and connect works great using that tarball:

http://www.confluent.io/developer#download

这篇关于kafka-connect 错误:无法找到或加载主类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆