Last active
January 13, 2024 20:51
-
-
Save padusumilli/7a8d9b1c8e97292695d90a1195a48c52 to your computer and use it in GitHub Desktop.
Docker compose with multiple kafka broker and schema registry
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.1' | |
services: | |
zookeeper-1: | |
image: confluentinc/cp-zookeeper:latest | |
environment: | |
ZOOKEEPER_SERVER_ID: 1 | |
ZOOKEEPER_CLIENT_PORT: 22181 | |
ZOOKEEPER_TICK_TIME: 2000 | |
ZOOKEEPER_INIT_LIMIT: 5 | |
ZOOKEEPER_SYNC_LIMIT: 2 | |
ZOOKEEPER_SERVERS: localhost:22888:23888;localhost:32888:33888;localhost:42888:43888 | |
network_mode: host | |
extra_hosts: | |
- "moby:127.0.0.1" | |
zookeeper-2: | |
image: confluentinc/cp-zookeeper:latest | |
environment: | |
ZOOKEEPER_SERVER_ID: 2 | |
ZOOKEEPER_CLIENT_PORT: 32181 | |
ZOOKEEPER_TICK_TIME: 2000 | |
ZOOKEEPER_INIT_LIMIT: 5 | |
ZOOKEEPER_SYNC_LIMIT: 2 | |
ZOOKEEPER_SERVERS: localhost:22888:23888;localhost:32888:33888;localhost:42888:43888 | |
network_mode: host | |
extra_hosts: | |
- "moby:127.0.0.1" | |
zookeeper-3: | |
image: confluentinc/cp-zookeeper:latest | |
environment: | |
ZOOKEEPER_SERVER_ID: 3 | |
ZOOKEEPER_CLIENT_PORT: 42181 | |
ZOOKEEPER_TICK_TIME: 2000 | |
ZOOKEEPER_INIT_LIMIT: 5 | |
ZOOKEEPER_SYNC_LIMIT: 2 | |
ZOOKEEPER_SERVERS: localhost:22888:23888;localhost:32888:33888;localhost:42888:43888 | |
network_mode: host | |
extra_hosts: | |
- "moby:127.0.0.1" | |
kafka-1: | |
image: confluentinc/cp-kafka:latest | |
network_mode: host | |
ports: | |
- "19092:19092" | |
depends_on: | |
- zookeeper-1 | |
- zookeeper-2 | |
- zookeeper-3 | |
environment: | |
KAFKA_BROKER_ID: 1 | |
KAFKA_ZOOKEEPER_CONNECT: localhost:22181,localhost:32181,localhost:42181 | |
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://10.21.11.71:19092 | |
extra_hosts: | |
- "moby:127.0.0.1" | |
kafka-2: | |
image: confluentinc/cp-kafka:latest | |
network_mode: host | |
ports: | |
- "29092:29092" | |
depends_on: | |
- zookeeper-1 | |
- zookeeper-2 | |
- zookeeper-3 | |
environment: | |
KAFKA_BROKER_ID: 2 | |
KAFKA_ZOOKEEPER_CONNECT: localhost:22181,localhost:32181,localhost:42181 | |
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://10.21.11.71:29092 | |
extra_hosts: | |
- "moby:127.0.0.1" | |
kafka-3: | |
image: confluentinc/cp-kafka:latest | |
network_mode: host | |
ports: | |
- "39092:39092" | |
depends_on: | |
- zookeeper-1 | |
- zookeeper-2 | |
- zookeeper-3 | |
environment: | |
KAFKA_BROKER_ID: 3 | |
KAFKA_ZOOKEEPER_CONNECT: localhost:22181,localhost:32181,localhost:42181 | |
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://10.21.11.71:39092 | |
extra_hosts: | |
- "moby:127.0.0.1" | |
schema_registry: | |
image: confluentinc/cp-schema-registry:latest | |
hostname: schema_registry | |
ports: | |
- 8082:8081 | |
environment: | |
SCHEMA_REGISTRY_HOST_NAME: schema_registry | |
SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: '10.21.11.71:22181,10.21.11.71:32181,10.21.11.71:42181' | |
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: 'PLAINTEXT://10.21.11.71:19092,PLAINTEXT://10.21.11.71:29092,PLAINTEXT://10.21.11.71:39092' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
10.21.11.71 - what is it?