Last active
March 18, 2024 03:34
-
-
Save rmoff/ba6c335367764953e390e273e019c083 to your computer and use it in GitHub Desktop.
Multi-node Kafka cluster (three brokers)
This file contains 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.8' | |
services: | |
zookeeper-1: | |
image: confluentinc/cp-zookeeper:5.5.1 | |
ports: | |
- '32181:32181' | |
environment: | |
ZOOKEEPER_CLIENT_PORT: 32181 | |
ZOOKEEPER_TICK_TIME: 2000 | |
kafka-1: | |
image: confluentinc/cp-kafka:5.5.1 | |
ports: | |
- '9092:9092' | |
depends_on: | |
- zookeeper-1 | |
environment: | |
KAFKA_BROKER_ID: 1 | |
KAFKA_ZOOKEEPER_CONNECT: zookeeper-1:32181 | |
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT | |
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL | |
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka-1:29092,EXTERNAL://localhost:9092 | |
KAFKA_DEFAULT_REPLICATION_FACTOR: 3 | |
KAFKA_NUM_PARTITIONS: 3 | |
kafka-2: | |
image: confluentinc/cp-kafka:5.5.1 | |
ports: | |
- '9093:9093' | |
depends_on: | |
- zookeeper-1 | |
environment: | |
KAFKA_BROKER_ID: 2 | |
KAFKA_ZOOKEEPER_CONNECT: zookeeper-1:32181 | |
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT | |
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL | |
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka-2:29093,EXTERNAL://localhost:9093 | |
KAFKA_DEFAULT_REPLICATION_FACTOR: 3 | |
KAFKA_NUM_PARTITIONS: 3 | |
kafka-3: | |
image: confluentinc/cp-kafka:5.5.1 | |
ports: | |
- '9094:9094' | |
depends_on: | |
- zookeeper-1 | |
environment: | |
KAFKA_BROKER_ID: 3 | |
KAFKA_ZOOKEEPER_CONNECT: zookeeper-1:32181 | |
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT | |
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL | |
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka-3:29094,EXTERNAL://localhost:9094 | |
KAFKA_DEFAULT_REPLICATION_FACTOR: 3 | |
KAFKA_NUM_PARTITIONS: 3 |
Author
rmoff
commented
Oct 12, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment