我正试图在3.1.0 Kafka集群中部署Schema Registry,该集群有3个运行良好的代理。我使用的是Docker 20.10.11和Portainer 2.9.0。我的问题是,它的配置中的boostrap.server属性是错误的,因为它一直在打印标题的错误:
org.apache.kafka.common.config.ConfigException: No resolvable bootstrap urls given in bootstrap.servers
该财产的实际价值为:
bootstrap.servers = [broker2:9092]
我的经纪人被命名为";kafka brokerx";x是经纪人的号码。我如何更改该配置,以便为我的broker更正名称??
我试着把它放在我的docker撰写的环境部分,但它并没有改变它,并不断打印错误。
- CONNECT_BOOTSTRAP_SERVERS= [kafka-broker1:9092, kafka-broker2:9092, kafka-broker3:9092]
我的码头工人作文:
version: "3.8"
networks:
net:
external: true
services:
kafka-broker1:
image: registry.gitlab.com/repo/kafka:2.13_3.1.0_v0.1
hostname: broker1
volumes:
- /var/volumes/kafka/config/server1.properties:/opt/kafka/config/server.properties
- /var/volumes/kafka/broker1-logs:/var/kafka-logs
environment:
- TZ=Europe/Madrid
networks:
- net
kafka-broker2:
image: registry.gitlab.com/repo/kafka:2.13_3.1.0_v0.1
hostname: broker2
volumes:
- /var/volumes/kafka/config/server2.properties:/opt/kafka/config/server.properties
- /var/volumes/kafka/broker2-logs:/var/kafka-logs
environment:
- TZ=Europe/Madrid
networks:
- distronet
kafka-broker3:
image: registry.gitlab.com/repo/kafka:2.13_3.1.0_v0.1
hostname: broker3
volumes:
- /var/volumes/kafka/config/server3.properties:/opt/kafka/config/server.properties
- /var/volumes/kafka/broker3-logs:/var/kafka-logs
environment:
- TZ=Europe/Madrid
networks:
- net
schema-registry:
image: confluentinc/cp-schema-registry:3.1.0
hostname: schema-registry
depends_on:
- broker
environment:
- SCHEMA_REGISTRY_HOST_NAME=schemaregistry
- SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL= zookeeper_node
- CONNECT_BOOTSTRAP_SERVERS= [kafka-broker1:9092, kafka-broker2:9092, kafka-broker3:9092]
ports:
- 8081:8081
问题是我忘了写"网络";标记,因此代理和架构注册表不在同一网络中,因此它不可能解析提供给服务的de-DNS主机名。