Tag: 汇合卡夫卡

架构registry容器:使用docker-compose启动时,服务器意外终止

我已经写了docker-compose.yml文件来创build下列容器: 汇合动物园pipe理员 汇合卡夫卡 汇合模式registry 我想要一个单一的docker-compose文件来创build必要的容器,公开所需的端口并互连相关的容器。 目标是让我使用Docker Hub的官方融合图像。 我的docker-compose文件如下所示: zookeeper: image: confluent/zookeeper container_name: confluent-zookeeper hostname: zookeeper environment: ZOOKEEPER_CLIENT_PORT: 2181 ports: – "2181:2181" kafka: environment: KAFKA_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181 KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092 image: confluent/kafka container_name: confluent-kafka hostname: kafka links: – zookeeper ports: – "9092:9092" schema-registry: image: confluent/schema-registry container_name: confluent-schema_registry environment: SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: zookeeper:2181 SCHEMA_REGISTRY_HOSTNAME: schema-registry SCHEMA_REGISTRY_LISTENERS: http://schema-registry:8081 SCHEMA_REGISTRY_DEBUG: 'true' SCHEMA_REGISTRY_KAFKASTORE_TOPIC_REPLICATION_FACTOR: '1' […]

无法连接在docker中运行的Kafka

我在docker compose yml文件中为广告的侦听器configuration了下面的configuration 我的docker-compose.yml version: '2' services: zookeeper: image: confluentinc/cp-zookeeper:latest network_mode: host environment: ZOOKEEPER_CLIENT_PORT: 32181 ZOOKEEPER_TICK_TIME: 2000 extra_hosts: – "moby:127.0.0.1" kafka: image: confluentinc/cp-kafka:latest network_mode: host depends_on: – zookeeper environment: KAFKA_BROKER_ID: 1 KAFKA_ZOOKEEPER_CONNECT: localhost:32181 KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://lnc52c9:29092 KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 extra_hosts: – "moby:127.0.0.1" 我使用下面的属性连接这个kafka props.put("bootstrap.servers", "lnc52c9:29092"); 当我尝试在该服务器中产生消息时,我收到下面的错误 警告o.apache.kafka.clients.NetworkClient – 使用关联ID 1获取元数据时出错:{foo = LEADER_NOT_AVAILABLE} 主机可以从我的机器ping通,因为它们都在同一个networking中,没有防火墙问题。 当我在docker容器中使用命令hostname ,我可以看到相同的主机名。 我错过了什么吗?