启动avroconverter时发生kafka连接错误

xhv8bpkk  于 2021-06-10  发布在  Cassandra
关注(0)|答案(1)|浏览(518)

我试着从一个主题转到Cassandra。该主题具有由kafka流创建的avro文件的模式注册表。
这是我的connect-standalone.properties:

bootstrap.servers=localhost:9092

key.converter=org.apache.kafka.connect.json.JsonConverter 
value.converter=org.apache.kafka.connect.json.JsonConverter

key.converter.schemas.enable=true   
value.converter.schemas.enable=true

offset.storage.file.filename=/tmp/connect.offsets  
offset.flush.interval.ms=10000

plugin.path=/usr/share/java

这是我的cassandra-sink.properties:

connector.class=io.confluent.connect.cassandra.CassandraSinkConnector 
cassandra.contact.points=ip.to.endpoint 
cassandra.port=9042 
cassandra.keyspace=my_keyspace 
cassandra.write.mode=Update 
tasks.max=1 
topics=avro-sink 
key.converter.schema.registry.url=http://localhost:8081 
value.converter.schema.registry.url=http://localhost:8081 
key.converter=org.apache.kafka.connect.storage.StringConverter 
value.converter=org.apache.kafka.connect.avro.AvroConverter 
name=cassandra-sink-connector 
internal.key.converter=org.apache.kafka.connect.storage.StringConverter
internal.value.converter=org.apache.kafka.connect.avro.AvroConverter
transforms=createKey 
transforms.createKey.fields=id,timestamp
transforms.createKey.type=org.apache.kafka.connect.transforms.ValueToKey

这就是错误:

[2019-03-15 16:32:05,238] ERROR Failed to create job for /etc/kafka/cassandra-sink.properties (org.apache.kafka.connect.cli.ConnectStandalone:108)
[2019-03-15 16:32:05,238] ERROR Stopping after connector error (org.apache.kafka.connect.cli.ConnectStandalone:119)
java.util.concurrent.ExecutionException: org.apache.kafka.connect.runtime.rest.errors.BadRequestException: Connector configuration is invalid and contains the following 1 error(s):
Invalid value org.apache.kafka.connect.avro.AvroConverter for configuration value.converter: Class org.apache.kafka.connect.avro.AvroConverter could not be found.
You can also find the above list of errors at the endpoint `/{connectorType}/config/validate`
        at org.apache.kafka.connect.util.ConvertingFutureCallback.result(ConvertingFutureCallback.java:79)
        at org.apache.kafka.connect.util.ConvertingFutureCallback.get(ConvertingFutureCallback.java:66)
        at org.apache.kafka.connect.cli.ConnectStandalone.main(ConnectStandalone.java:116)
Caused by: org.apache.kafka.connect.runtime.rest.errors.BadRequestException: Connector configuration is invalid and contains the following 1 error(s):
Invalid value org.apache.kafka.connect.avro.AvroConverter for configuration value.converter: Class org.apache.kafka.connect.avro.AvroConverter could not be found.
You can also find the above list of errors at the endpoint `/{connectorType}/config/validate`
        at org.apache.kafka.connect.runtime.AbstractHerder.maybeAddConfigErrors(AbstractHerder.java:423)
        at org.apache.kafka.connect.runtime.standalone.StandaloneHerder.putConnectorConfig(StandaloneHerder.java:188)
        at org.apache.kafka.connect.cli.ConnectStandalone.main(ConnectStandalone.java:113)

这个经纪人可以在https://github.com/confluentinc/cp-docker-images
有什么想法吗?谢谢!

jum4pzuy

jum4pzuy1#

我通过删除所有转换器属性来解决这个问题,因为默认值已经是合流docker容器上value的avro和key的string

相关问题