运行Kafka Connect与Avro Converter:ConfigException:“Missing Schema registry url”

时间:2016-10-22 13:40:27

标签: apache-kafka confluent apache-kafka-connect

我正在运行Kafka Connect泊坞窗图像

docker run -d \
  --name=kafka-connect \
  --net=host \
  -e CONNECT_BOOTSTRAP_SERVERS=localhost:39092 \
  -e CONNECT_REST_PORT=28082 \
  -e CONNECT_GROUP_ID="quickstart" \
  -e CONNECT_CONFIG_STORAGE_TOPIC="quickstart-config" \
  -e CONNECT_OFFSET_STORAGE_TOPIC="quickstart-offsets" \
  -e CONNECT_STATUS_STORAGE_TOPIC="quickstart-status" \
  -e CONNECT_KEY_CONVERTER="io.confluent.connect.avro.AvroConverter" \
  -e CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL="http://localhost:8081" \
  -e CONNECT_VALUE_CONVERTER="io.confluent.connect.avro.AvroConverter" \
  -e CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL="http://localhost:8081" \
  -e CONNECT_INTERNAL_KEY_CONVERTER="io.confluent.connect.avro.AvroConverter" \
  -e CONNECT_INTERNAL_VALUE_CONVERTER="io.confluent.connect.avro.AvroConverter" \
  -e CONNECT_REST_ADVERTISED_HOST_NAME="localhost" \
  -e CONNECT_ZOOKEEPER_CONNECT="localhost:2181" \
  tim/kafka-connect

并获得

Exception in thread "main" org.apache.kafka.common.config.ConfigException: Missing Schema registry url!
    at io.confluent.connect.avro.AvroConverter.configure(AvroConverter.java:64)
    at org.apache.kafka.connect.runtime.Worker.<init>(Worker.java:93)
    at org.apache.kafka.connect.cli.ConnectDistributed.main(ConnectDistributed.java:74)

无法确定在哪里添加“schema.registry.url”conf !!

2 个答案:

答案 0 :(得分:4)

问题在于_INTERNAL_VALUE__KEY_CONVERTER
我没有像_KEY_VALUEorg.apache.kafka.connect.json.JsonConverter那样为这两个方法添加SCHEMA_REGISTRY_URL,无论如何我切换回Array.prototype.br_search = function (target) { var half = parseInt(this.length / 2); if (target === this[half]) { return half; } if (target > this[half]) { return half + this.slice(half,this.length).br_search(target); } else { return this.slice(0, half).br_search(target); } }; l= [0,1,2,3,4,5,6]; console.log(l.br_search(5)); 获取内部键和值

答案 1 :(得分:0)

如果您使用的是.properties文件,则需要:

:internal.key.converter.schema.registry.url http://urlgoes.here
:internal.value.converter.schema.registry.url http://urlgoes.here

如果您传入命令行环境变量,则需要:

INTERNAL_KEY_CONVERTER_SCHEMA_REGISTRY_URL=http://urlgoes.here
INTERNAL_VALUE_CONVERTER_SCHEMA_REGISTRY_URL=http://urlgoes.here