Apache kafka 缺少所需的配置“;键。转换器“;没有德福

Apache kafka 缺少所需的配置“;键。转换器“;没有德福,apache-kafka,apache-kafka-connect,Apache Kafka,Apache Kafka Connect,当我尝试启动Kafka connect for elastic search reactor时,在独立模式下,我收到以下错误: Exception in thread "main" org.apache.kafka.common.config.ConfigException: Missing required configuration "key.converter" which has no default value. at org.apache.kafka.common.c

当我尝试启动Kafka connect for elastic search reactor时,在独立模式下,我收到以下错误:

Exception in thread "main" org.apache.kafka.common.config.ConfigException: Missing required configuration "key.converter" which has no default value.
        at org.apache.kafka.common.config.ConfigDef.parseValue(ConfigDef.java:463)
        at org.apache.kafka.common.config.ConfigDef.parse(ConfigDef.java:453)
        at org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:62)
        at org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:75)
        at org.apache.kafka.connect.runtime.WorkerConfig.<init>(WorkerConfig.java:218)
        at org.apache.kafka.connect.runtime.distributed.DistributedConfig.<init>(DistributedConfig.java:272)
        at org.apache.kafka.connect.cli.ConnectDistributed.main(ConnectDistributed.java:72)
按顺序为connect-standalone.properties:

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# These are defaults. This file just demonstrates how to override some 
settings.
bootstrap.servers=localhost:9092

# The converters specify the format of data in Kafka and how to translate it 
into Connect data. Every Connect user will
# need to configure these based on the format they want their data in when 
loaded from or stored into Kafka
key.converter=org.apache.kafka.connect.json.JsonConverter
value.converter=org.apache.kafka.connect.json.JsonConverter
# Converter-specific settings can be passed in by prefixing the Converter's 
setting with the converter we want to apply
# it to
key.converter.schemas.enable=true
value.converter.schemas.enable=true

# The internal converter used for offsets and config data is configurable 
and must be specified, but most users will
# always want to use the built-in default. Offset and config data is never 
visible outside of Copcyat in this format.
internal.key.converter=org.apache.kafka.connect.json.JsonConverter
internal.value.converter=org.apache.kafka.connect.json.JsonConverter
internal.key.converter.schemas.enable=false
internal.value.converter.schemas.enable=false

offset.storage.file.filename=/tmp/connect.offsets
# Flush much faster than normal, which is useful for testing/debugging
offset.flush.interval.ms=10000
plugin.path=/home/ubuntu/kafka_2.11-1.0.1/libs
这是另一个文件:

name=elasticsearch-sink
    connector.class=io.confluent.connect.elasticsearch.ElasticsearchSinkConnector
    tasks.max=1
    topics=test
    topic.index.map=test:test_index
    connection.url=myurl
    type.name=log
    key.ignore=true
    schema.ignore=true

这个错误说明了一切。您缺少
key.converter
所需的配置条目。这告诉Kafka Connect如何反序列化Kafka主题上的数据(通常是JSON或Avro)

您可以在中看到Elasticsearch的有效连接器配置示例。如果您将问题更新为包含您正在使用的配置,我可以指出如何合并它


查看配置后,出现错误的原因是您使用配置文件以错误的顺序调用Connect,因此Connect找不到所需的配置

应该是:

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

阅读更多有关从Kafka到Elasticsearch的流式传输的信息,以及有关使用Kafka Connect的常规系列:


我已更新我的问题添加配置文件。你能帮我解决这个错误吗?谢谢你啊,你调用它的顺序不对。需要是
工作者配置连接器配置
,即
/bin/connect-standalone.sh配置/connect-standalone.properties配置/elastic配置.properties
./bin/connect-standalone.sh config/connect-standalone.properties config/elastic-config.properties