Updated Confluent-Kafka to `7.5.1` and switched the cluster to KRAFT
authorKai Moritz <kai@juplo.de>
Sun, 5 May 2024 07:54:47 +0000 (09:54 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 15 Jun 2024 11:16:47 +0000 (13:16 +0200)
README.sh
docker-compose.yml

index ba50a69..b6f9a3c 100755 (executable)
--- a/README.sh
+++ b/README.sh
@@ -53,11 +53,10 @@ else
 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
index c02465a..f057280 100644 (file)
@@ -1,29 +1,27 @@
 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"