2017-09-14 87 views
0

我試圖從運行的匯合插件kafka-connect-elasticsearch爲了從卡夫卡(V0.11.0.1)直接進入Elasticsearch流主題(沒有把Logstash之間)。卡夫卡連接Elasticsearch - 的NoSuchMethodError

我建立使用Maven連接器 -

$ cd kafka-connect-elasticsearch 
$ mvn clean package 

然後我創建了需要的配置文件 -

name=es-cluster-lab 
connector.class=io.confluent.connect.elasticsearch.ElasticsearchSinkConnector 
tasks.max=1 
topics=filebeats-test 
topic.index.map=filebeats-test:kafka_test_index 
key.ignore=true 
schema-ignore=true 
connection.url=http://elastic:9200 
type.name=log 

根據新卡夫卡的Classpath隔離規範,我還添加了下面一行到我connect-standalone.properties文件 -

plugin.path=/home/kafka/kafka-connect-elasticsearch-3.3.0/target/kafka-connect-elasticsearch-3.3.0-development/share/java/kafka-connect-elasticsearch/ 

我去運行腳本...

bin/connect-standalone.sh config/connect-standalone.properties config/elasticsearch-connect.properties 

...並收到下面的錯誤。

[2017-09-14 16:08:26,599] INFO Loading plugin from: /home/kafka/kafka-connect-elasticsearch-3.3.0/target/kafka-connect-elasticsearch-3.3.0-development/share/java/kafka-connect-elasticsearch/slf4j-api-1.7.25.jar (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:176) 
Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.collect.Sets$SetView.iterator()Lcom/google/common/collect/UnmodifiableIterator; 
     at org.reflections.Reflections.expandSuperTypes(Reflections.java:380) 
     at org.reflections.Reflections.<init>(Reflections.java:126) 
     at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.scanPluginPath(DelegatingClassLoader.java:221) 
     at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.scanUrlsAndAddPlugins(DelegatingClassLoader.java:198) 
     at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.registerPlugin(DelegatingClassLoader.java:190) 
     at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.initLoaders(DelegatingClassLoader.java:150) 
     at org.apache.kafka.connect.runtime.isolation.Plugins.<init>(Plugins.java:47) 
     at org.apache.kafka.connect.cli.ConnectStandalone.main(ConnectStandalone.java:68) 

我也試圖在JAR文件移動到/app/kafka/libs directory(默認CLASSPATH)甚至試圖創建一個子目錄/app/kafka/libs/connect_libs和手動添加到我的CLASSPATH環境變量。

不知道我的下一步是什麼,除了把卡爾卡和Elastic之間的Logstash。

回答

0

嘗試番石榴的版本改爲20你建立了

0

我認爲你缺少明星之前「*」在插件路徑的路徑的末尾。

plugin.path=/home/kafka/kafka-connect-elasticsearch-3.3.0/target/kafka-connect-elasticsearch-3.3.0-development/share/java/kafka-connect-elasticsearch/*