version: '3.2'
services:
- zookeeper:
+ zookeeper-1:
image: confluentinc/cp-zookeeper:7.5.1
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ports:
- 2181:2181
volumes:
- - zookeeper-data:/var/lib/zookeeper/data
- - zookeeper-log:/var/lib/zookeeper/log
+ - zookeeper-1-data:/var/lib/zookeeper/data
+ - zookeeper-1-log:/var/lib/zookeeper/log
+
+ zookeeper-2:
+ image: confluentinc/cp-zookeeper:7.5.1
+ environment:
+ ZOOKEEPER_CLIENT_PORT: 2181
+ ports:
+ - 2182:2181
+ volumes:
+ - zookeeper-2-data:/var/lib/zookeeper/data
+ - zookeeper-2-log:/var/lib/zookeeper/log
+
+ zookeeper-3:
+ image: confluentinc/cp-zookeeper:7.5.1
+ environment:
+ ZOOKEEPER_CLIENT_PORT: 2181
+ ports:
+ - 2183:2181
+ volumes:
+ - zookeeper-3-data:/var/lib/zookeeper/data
+ - zookeeper-3-log:/var/lib/zookeeper/log
kafka-1:
image: confluentinc/cp-kafka:7.5.1
environment:
- KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
+ KAFKA_ZOOKEEPER_CONNECT: zookeeper-1:2181
KAFKA_LISTENERS: BROKER://:9092, LOCALHOST://:9081
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: BROKER:PLAINTEXT, LOCALHOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: BROKER://kafka-1:9092, LOCALHOST://localhost:9081
- 9081:9081
stop_grace_period: 120s
depends_on:
- - zookeeper
+ - zookeeper-1
kafka-2:
image: confluentinc/cp-kafka:7.5.1
environment:
- KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
+ KAFKA_ZOOKEEPER_CONNECT: zookeeper-2:2181
KAFKA_LISTENERS: BROKER://:9092, LOCALHOST://:9082
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: BROKER:PLAINTEXT, LOCALHOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: BROKER://kafka-2:9092, LOCALHOST://localhost:9082
- kafka
stop_grace_period: 120s
depends_on:
- - zookeeper
+ - zookeeper-2
kafka-3:
image: confluentinc/cp-kafka:7.5.1
environment:
- KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
+ KAFKA_ZOOKEEPER_CONNECT: zookeeper-3:2181
KAFKA_LISTENERS: BROKER://:9092, LOCALHOST://:9083
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: BROKER:PLAINTEXT, LOCALHOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: BROKER://kafka-3:9092, LOCALHOST://localhost:9083
- 9083:9083
stop_grace_period: 120s
depends_on:
- - zookeeper
+ - zookeeper-3
schema-registry:
image: confluentinc/cp-schema-registry:7.5.1
environment:
HTTP_PORT: 80
CONNECTION_JUPLO_NAME: juplo
- CONNECTION_JUPLO_CONN: zookeeper:2181
+ CONNECTION_JUPLO_CONN: zookeeper-1:2181
AUTO_CONNECT_CONNECTION_ID: JUPLO
depends_on:
- - zookeeper
+ - zookeeper-1
+ - zookeeper-2
+ - zookeeper-3
akhq:
image: tchiotludo/akhq:0.23.0
command: kafka:9092 test my-group consumer
volumes:
- zookeeper-data:
- zookeeper-log:
+ zookeeper-1-data:
+ zookeeper-1-log:
+ zookeeper-2-data:
+ zookeeper-2-log:
+ zookeeper-3-data:
+ zookeeper-3-log:
kafka-1-data:
kafka-2-data:
kafka-3-data: