问题
I am following the official docs to implement the kakf-connect
to read data from a file.
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
I am getting the following error:
Error: Could not find or load main class 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
.
My connect-file-source.properties
is as follows:
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?
回答1:
So being fairly java ignorant I think that the problem is that kafka-connect isn't included in the tarballs that kafka provides.
I instead switched to using the confluent platform, and connect works great using that tarball:
http://www.confluent.io/developer#download
来源:https://stackoverflow.com/questions/35179108/kafka-connect-error-cannot-find-or-load-main-class