fi
-docker-compose up -d zookeeper kafka cli traefik
+docker-compose up -d kafka cli traefik
echo "Waiting for the Kafka-Cluster to become ready..."
docker-compose exec cli cub kafka-ready -b kafka:9092 1 60 > /dev/null 2>&1 || exit 1
-docker-compose exec cli zookeeper-shell zookeeper:2181 ls /brokers/ids
docker-compose up -d users
while [ "$(http users.localhost/actuator/health 2> /dev/null | jq -r .status 2> /dev/null)" != "UP" ]; do echo "Waiting for service users..."; sleep 1; done
version: '3.2'
services:
- zookeeper:
- image: confluentinc/cp-zookeeper:6.2.0
- environment:
- ZOOKEEPER_CLIENT_PORT: 2181
- ports:
- - 2181:2181
kafka:
- image: confluentinc/cp-kafka:6.2.0
+ image: confluentinc/cp-kafka:7.5.1
environment:
- KAFKA_BROKER_ID: 1
- KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
- KAFKA_LISTENERS: DOCKER://:9092, LOCALHOST://:9082
+ KAFKA_NODE_ID: 1
+ KAFKA_LISTENERS: CONTROLLER://:9072, DOCKER://:9092, LOCALHOST://:9082
KAFKA_ADVERTISED_LISTENERS: DOCKER://kafka:9092, LOCALHOST://localhost:9082
KAFKA_INTER_BROKER_LISTENER_NAME: DOCKER
- KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: DOCKER:PLAINTEXT, LOCALHOST:PLAINTEXT
+ KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT, DOCKER:PLAINTEXT, LOCALHOST:PLAINTEXT
+ KAFKA_PROCESS_ROLES: broker, controller
+ KAFKA_CONTROLLER_QUORUM_VOTERS: 1@kafka:9072
+ KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
+ CLUSTER_ID: MkU3OEVBNTcwNTJENDM2Qk
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
+ KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
+ KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
+ KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
ports:
- 9092:9082
- 9082:9082
- depends_on:
- - zookeeper
-
+ stop_grace_period: 120s
traefik:
image: "traefik:v2.5"