Kafka Error: Could not find or load main class org

2019-07-20 16:36发布

问题:

I was trying to run Performance test as per the following article for Apache Kafka

Reference:

https://engineering.linkedin.com/kafka/benchmarking-apache-kafka-2-million-writes-second-three-cheap-machines

Linked-in tests: https://gist.github.com/jkreps/c7ddb4041ef62a900e6c

But when I run this:

 bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=localhost:9092 buffer.memory=67108864 batch.size=8196

It shows the error:

Error: Could not find or load main class org.apache.kafka.clients.tools.ProducerPerformance

Is it about kafka version? Or I need to download the class from somewhere else?

Where is my org.apache.kafka.clients.tools.ProducerPerformance class? Please suggest..

回答1:

Package name of ProducerPerformance has been changed from org.apache.kafka.clients.tools to org.apache.kafka.tools.

For more details, check my answer for a possible duplicate question.



回答2:

I think you need to build the project first before running this command .. you can use build tool such as sbt as documented in their official web site