Created
September 19, 2023 07:43
-
-
Save StrikeW/f4a1d78c1d0adb7501534f5900ba70fa to your computer and use it in GitHub Desktop.
Kafka docker compose
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' | |
services: | |
zookeeper: | |
image: confluentinc/cp-zookeeper:7.2.1 | |
container_name: zookeeper | |
environment: | |
ZOOKEEPER_CLIENT_PORT: 2181 | |
kafka1: | |
image: confluentinc/cp-kafka:7.2.1 | |
container_name: kafka1 | |
ports: | |
- "9094:9094" | |
depends_on: | |
- zookeeper | |
environment: | |
KAFKA_BROKER_ID: 1 | |
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 | |
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: EXTERNAL:PLAINTEXT,INTERNAL:PLAINTEXT | |
KAFKA_ADVERTISED_LISTENERS: EXTERNAL://localhost:9094,INTERNAL://kafka1:9092 | |
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL | |
kafka2: | |
image: confluentinc/cp-kafka:7.2.1 | |
container_name: kafka2 | |
ports: | |
- "9095:9095" | |
depends_on: | |
- zookeeper | |
environment: | |
KAFKA_BROKER_ID: 2 | |
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 | |
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: EXTERNAL:PLAINTEXT,INTERNAL:PLAINTEXT | |
KAFKA_ADVERTISED_LISTENERS: EXTERNAL://localhost:9095,INTERNAL://kafka2:9092 | |
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL | |
kafka3: | |
image: confluentinc/cp-kafka:7.2.1 | |
container_name: kafka3 | |
ports: | |
- "9096:9096" | |
depends_on: | |
- zookeeper | |
environment: | |
KAFKA_BROKER_ID: 3 | |
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 | |
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: EXTERNAL:PLAINTEXT,INTERNAL:PLAINTEXT | |
KAFKA_ADVERTISED_LISTENERS: EXTERNAL://localhost:9096,INTERNAL://kafka3:9092 | |
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment