Kafka性能测试不可用 [英] Kafka performance test not available

查看:110
本文介绍了Kafka性能测试不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Kafka的新手,使用的是 kafka_2.8.0-0.8.1.1 的版本.

I'm a newbie for Kafka, using the version of kafka_2.8.0-0.8.1.1.

建立了Kafka经纪人并通过生产商和消费者进行了良好的测试之后,我决定对Kafka进行一些性能测试.

After build Kafka brokers and test it by producer and consumer that work fine, I decide to make some performance test for Kafka.

我通过搜索 kafka性能测试找到了 Kafka基准通过执行

I found Kafka Benchmark by search kafka performance test and try it by execute

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

但是得到了

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

然后我发现测试kafka的另一种方法是命令

Then I found another way to test kafka is the command

./bin/kafka-producer-perf-test.sh --broker-list 192.168.2.11:19092,192.168.2.11:19093,192.168.2.11:19094 --messages 100 --topic j1-soa --threads 1 --message-size 100 --batch-size 100 --compression-codec 1

得到另一个错误是

Error: Could not find or load main class kafka.perf.ProducerPerformance

我搜索了错误.他们告诉它应该执行

I searched the errors. they told it should execute some command like

./sbt update
./sbt package
./sbt assembly-package-dependency

./gradlew jar

在执行 ./bin/kafka-producer-perf-test.sh 之前.

我意识到上述命令仅适用于源代码版本,而不适用于二进制版本.

I realize the above commands only working for Source version instead Binary version.

然后我下载 kafka-0.8.1.1-src.tgz 并尝试执行上述命令.

Then I download the kafka-0.8.1.1-src.tgz and trying to execute above commands.

我不知道什么是 sbt gradlew .

我只是尝试运行以上命令.

I just trying to running above commands.

运行 sbt assembly-package-dependency

[info] Set current project to kafka (in build file:/Users/foxzen/Develop/kafka/)
[error] Not a valid command: assembly-package-dependency
[error] Not a valid project ID: assembly-package-dependency
[error] Expected ':' (if selecting a configuration)
[error] Not a valid key: assembly-package-dependency (similar: sbt-dependency)
[error] assembly-package-dependency
[error]                            ^

./gradlew jar

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'kafka-0.8.1.1-src'.
> Could not resolve all dependencies for configuration ':classpath'.
  > Could not resolve nl.javadude.gradle.plugins:license-gradle-plugin:0.6.1.
 Required by:
     org.apache.kafka:kafka-0.8.1.1-src:0.8.1.1
  > Could not GET 'http://repo1.maven.org/maven2/nl/javadude/gradle/plugins/license-gradle-plugin/0.6.1/license-gradle-plugin-0.6.1.pom'.
     > Connection to http://127.0.0.1:8888 refused
  > Could not GET 'http://dl.bintray.com/content/netflixoss/external-gradle-plugins/nl/javadude/gradle/plugins/license-gradle-plugin/0.6.1/license-gradle-plugin-0.6.1.pom'.
     > Connection to http://127.0.0.1:8888 refused

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 2.924 secs

我真的不知道错误消息是什么意思,并且找不到解决方法.

I really do not know what the error message means, and can not found a solution.

如何使命令 ./bin/kafka-producer-perf-test.sh 正常工作,以便我可以测试Kafka的性能?

How to make the command ./bin/kafka-producer-perf-test.sh work fine so I can test Kafka performance ?

编辑

导致 ./gradlew jar 失败是我的错.

Internet连接的代理设置为 127.0.0.1:8888

The internet connection have proxy setting to 127.0.0.1:8888,

我不记得是什么时候做的...

I cant remember when did I do it...

在删除Internet连接的代理设置之后. ./gradlew jar 命令正常.

After remove proxy setting of Internet connection. the ./gradlew jar command works ok.

但是我又遇到了另一个错误........

But I got another error, again........

start.time, end.time, compression, message.size, batch.size, total.data.sent.in.MB, MB.sec, total.data.sent.in.nMsg, nMsg.sec
[2015-02-04 10:37:22,936] WARN Property reconnect.interval is not valid (kafka.utils.VerifiableProperties)
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
2015-02-04 10:37:22:821, 2015-02-04 10:37:23:451, 1, 100, 100, 0.01, 0.0151, 100, 158.7302

引起./bin/kafka-producer-perf-test.sh --broker-list 192.168.2.11:19092,192.168.2.11:19093,192.168.2.11:19094-消息100 --topicj1-soa --threads 1 --message-size 100 --batch-size 100 --compression-codec 1

这是否意味着性能测试成功?

Is this mean the performance test success ?

但是我没有得到有意义的输出.

But I did not get a meaningful output.

我认为错误信息应该是

无法加载类"org.slf4j.impl.StaticLoggerBinder".

如何解决?

推荐答案

ProducerPerformance 的软件包名称已从 org.apache.kafka.clients.tools org.apache.kafka.tools .

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

因此,您应该正在运行:

So, you should be running:

<代码> ./bin/kafka-run-class.sh org.apache.kafka.tools.ProducerPerformance test7 50000000 100 -1 acks = 1 bootstrap.servers = esv4-hcl198.grid.linkedin.com:9092缓冲区.memory = 67108864 batch.size = 8196

更改已在此提交中进行.

这篇关于Kafka性能测试不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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