confluentinc / cp-docker-images

[DEPRECATED] Docker images for Confluent Platform.
Apache License 2.0
1.14k stars 703 forks source link

Connecting Schema-Registry Docker Container to AWS MSK (Kafka Cluster) #781

Open navinsnn53 opened 5 years ago

navinsnn53 commented 5 years ago

Hi Guys ,

I am not able to connect schema registry to MSK. I am running Docker in a separate instance and have connections enabled to MSK services.

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

Error faced when connecting with SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL is below

[main-EventThread] INFO org.apache.zookeeper.ClientCnxn - EventThread shut down for session: 0x30000003c6e0008 [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}]

Also tried to replace SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL with SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS

docker run -d \ --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

Still getting error with below message

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



Any known issue?? Can some one guide me on this.
mwesox commented 4 years ago

@navinsnn53 : Did you find any solution / workaround for this issue ?

gabipetrovay commented 4 years ago

I had the same issue and fixed it by:

  1. removing the deprecated SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL and
  2. for SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS I used only the PLAINTEXT Docker/AWS-internal listener(s) (not the public DNS-name); in Docker this is the container_name.