How to install schema registry
Asked Answered
R

2

13

I am looking options to install confluent schema registry, is it possible to download and install registry alone and make it work with existing kafka setup ?

Thanks

Rowdyish answered 27/12, 2017 at 9:3 Comment(0)
T
10

Assuming you have Zookeeper/Kafka running already, you can easily run Confulent Schema Registry using Docker with running the following command:

docker run -p 8081:8081 -e \
    SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL=host.docker.internal:2181 \
    -e SCHEMA_REGISTRY_HOST_NAME=localhost \
    -e SCHEMA_REGISTRY_LISTENERS=http://0.0.0.0:8081 \
    -e SCHEMA_REGISTRY_DEBUG=true confluentinc/cp-schema-registry:5.3.2

parameters:

-p 8081:8081 - will open the port 8081 between the container to your machine

SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL - is your Zookeeper host and port, I'm using host.docker.internal to resolve local machine that is hosting Zookeeper (outside of the container)

SCHEMA_REGISTRY_HOST_NAME - The hostname advertised in Zookeeper. This is required if if you are running Schema Registry with multiple nodes. Hostname is required because it defaults to the Java canonical hostname for the container, which may not always be resolvable in a Docker environment.

SCHEMA_REGISTRY_LISTENERS - the Schema Registry host and port number to open

SCHEMA_REGISTRY_DEBUG Run in debug mode

note: the script was using the version 5.3.2, make sure this version is aligned with your Kafka version.

Tania answered 27/12, 2019 at 20:32 Comment(4)
in the logs i see the following message :- "[kafka-admin-client-thread | adminclient-1] WARN org.apache.kafka.clients.NetworkClient - [AdminClient clientId=adminclient-1] Connection to node -1 (/192.168.0.102:9092) could not be established. Broker may not be available." where the broker is running at localhsot:9092, how do i change this ?Hambrick
It is failing for me and throwing - [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 [{EXTERNAL=localhost:9094, INTERNAL=kafka-0.kafka-headless.kafka.svc.cluster.local:9093, CLIENT=kafka-0.kafka-headless.kafka.svc.cluster.local:9092}] at io.confluent.admin.utils.cli.KafkaReadyCommand.main(KafkaReadyCommand.java:143)Dyarchy
can you please share link to some documentation where this is explained in depth? I'm getting: Couldn't resolve server utu.unassigned-domain:9092 from bootstrap.servers as DNS resolution failed for utu.unassigned-domain and cannot find any way how to pass here correct bootstrap.servers.Inaccessible
@MartinMucha - make sure you're pointing SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL to Zookeeper host:port and not the Kafka, if you can post the whole command I can try to help you further, this is why the port is 2181 and not 9092 or 9093Tania
U
3

Yes you can use your existing Kafka setup, just match to the compatible version of Confluent Platform. Here are the docs on getting started

https://docs.confluent.io/current/schema-registry/docs/intro.html#installation

tl;dr download the platform to pull out the pieces you need or get the docker image and point it at your Kafka cluster.

Urogenital answered 31/12, 2017 at 13:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.