1

我无法将架构注册表连接到 MSK。我在一个单独的实例中运行 Docker,并启用了与 MSK 服务的连接。

尝试了来自 confluent docker.io/confluentinc/cp-schema-registry:latest 的 docker 镜像。

docker run -d \
--net=host 
--name=schema-registry 
-e SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL=10.95.21.38:2181 
-e SCHEMA_REGISTRY_HOST_NAME=schema-registry 
-e SCHEMA_REGISTRY_LISTENERS=
http://schema-registry:8081 
-e SCHEMA_REGISTRY_DEBUG=true 
docker.io/confluentinc/cp-schema-registry:latest

与 SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL 连接时遇到的错误如下

[main] ERROR io.confluent.admin.utils.cli.KafkaReadyCommand - Error while running kafka-ready.
java.lang.RuntimeException: No endpoints found for security protocol [PLAINTEXT]. Endpoints found in ZK [{REPLICATION=b-1-internal.kafkaclusternew.jbf0pp.c4.kafka.us-west-2.amazonaws.com:9093, CLIENT=b-1.kafkaclusternew.jbf0pp.c4.kafka.us-west-2.amazonaws.com:9092, CLIENT_SECURE=b-1.kafkaclusternew.jbf0pp.c4.kafka.us-west-2.amazonaws.com:9094, REPLICATION_SECURE=b-1-internal.kafkaclusternew.jbf0pp.c4.kafka.us-west-2.amazonaws.com:9095}]

还尝试将 SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL 替换为 SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS

  --net=host \
  --name=schema-registry \
  -e SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS=PLAINTEXT://b-2.kafkaclusternew.jbf0pp.c4.kafka.us-west-2.amazonaws.com:9092,b-3.kafkaclusternew.jbf0pp.c4.kafka.us-west-2.amazonaws.com:9092,b-1.kafkaclusternew.jbf0pp.c4.kafka.us-west-2.amazonaws.com:9092 \
  -e SCHEMA_REGISTRY_HOST_NAME=schema-registry \
  -e SCHEMA_REGISTRY_LISTENERS=http://schema-registry:8081 \
  -e SCHEMA_REGISTRY_DEBUG=true \
  docker.io/confluentinc/cp-schema-registry:latest

仍然失败并出现以下错误

ERROR Server died unexpectedly:  (io.confluent.kafka.schemaregistry.rest.SchemaRegistryMain)
java.net.SocketException: Unresolved address

请对此提出任何解决方案。

4

1 回答 1

0

我有同样的问题,不得不使用

SCHEMA_REGISTRY_BOOTSTRAP_SERVERS

代替

SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS

. 希望有帮助。

于 2019-08-30T06:48:33.580 回答