ksql datagen-java.lang.classnotfoundexception:监视ProducerInterceptor

wpcxdonn  于 2021-06-07  发布在  Kafka
关注(0)|答案(2)|浏览(409)

我正在探索合流Kafka和以下从合流快速入门指南。我要走了 java.lang.ClassNotFoundException: io.confluent.monitoring.clients.interceptor.MonitoringProducerInterceptor 每当我尝试使用以下命令为Kafka主题创建一些示例数据时:

bin/ksql-datagen quickstart=pageviews format=delimited topic=pageviews maxInterval=100 \ propertiesFile=etc/ksql/datagen.properties

这是堆栈跟踪

Outputting 1000000 to pageviews
[2018-08-01 11:37:06,323] INFO AvroDataConfig values: 
    schemas.cache.config = 1
    enhanced.avro.schema.support = false
    connect.meta.data = true
 (io.confluent.connect.avro.AvroDataConfig:179)
Exception in thread "main" org.apache.kafka.common.KafkaException: Failed to construct kafka producer
    at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:460)
    at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:320)
    at io.confluent.ksql.datagen.DataGenProducer.populateTopic(DataGenProducer.java:76)
    at io.confluent.ksql.datagen.DataGen.main(DataGen.java:100)
Caused by: org.apache.kafka.common.KafkaException: io.confluent.monitoring.clients.interceptor.MonitoringProducerInterceptor ClassNotFoundException exception occurred
    at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstances(AbstractConfig.java:357)
    at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstances(AbstractConfig.java:332)
    at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstances(AbstractConfig.java:319)
    at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:381)
    ... 3 more
Caused by: java.lang.ClassNotFoundException: io.confluent.monitoring.clients.interceptor.MonitoringProducerInterceptor
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at org.apache.kafka.common.utils.Utils.loadClass(Utils.java:333)
    at org.apache.kafka.common.utils.Utils.newInstance(Utils.java:322)
    at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstances(AbstractConfig.java:355)
    ... 6 more

我已经遵循了快速入门指南中给出的每一步,我做错了什么?
我甚至重申了合流,但仍然得到相同的错误,而不是什么在这个谷歌集团的答案中提到的

hm2xizp9

hm2xizp91#

放置 monitoring-interceptors.jar 在ksql(或者哪个融合服务由于这个错误而失败)中,classpath($confluent\u home/share/java/ksql/)应该可以解决这个问题
jar可能位于汇合maven回购之外
$confluent\u home/share/java/monitoring interceptors/monitoring interceptors-*.jar

eaf3rand

eaf3rand2#

我在/etc/ksql/datagen.properties中遇到了同样的问题,发现它只适用于confluent enterprise:


# This properties file should ONLY be used when you run KSQL with Confluent Enterprise Platform.

interceptor.classes=io.confluent.monitoring.clients.interceptor.MonitoringProducerInterceptor

它在删除属性文件后工作:

/bin/ksql-datagen quickstart=pageviews format=delimited topic=pageviews maxInterval=100

相关问题