Umstellung auf 1 Controller und 3 Broker
authorKai Moritz <kai@juplo.de>
Wed, 26 Oct 2022 17:00:45 +0000 (19:00 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 29 Oct 2022 11:38:43 +0000 (13:38 +0200)
docker-compose.yml

index 8647a4a..293db15 100644 (file)
@@ -1,17 +1,33 @@
 version: '3.2'
 services:
+  kafka-0:
+    image: bitnami/kafka:3.3.1
+    environment:
+      KAFKA_ENABLE_KRAFT: 'yes'
+      KAFKA_KRAFT_CLUSTER_ID: r7dMBY60T16TrNCGeXniLw
+      KAFKA_CFG_PROCESS_ROLES: controller
+      KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER
+      KAFKA_CFG_LISTENERS: CONTROLLER://:9092
+      KAFKA_CFG_ADVERTISED_LISTENERS: " "
+      KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT
+      KAFKA_BROKER_ID: 0
+      KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: 0@kafka-0:9092
+      ALLOW_PLAINTEXT_LISTENER: 'yes'
+      KAFKA_CFG_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
+      KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE: "false"
+
   kafka-1:
     image: bitnami/kafka:3.3.1
     environment:
       KAFKA_ENABLE_KRAFT: 'yes'
       KAFKA_KRAFT_CLUSTER_ID: r7dMBY60T16TrNCGeXniLw
-      KAFKA_CFG_PROCESS_ROLES: broker,controller
+      KAFKA_CFG_PROCESS_ROLES: broker
       KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER
-      KAFKA_CFG_LISTENERS: BROKER://:9092, CONTROLLER://:9093, LOCALHOST://:9081
+      KAFKA_CFG_LISTENERS: BROKER://:9092, LOCALHOST://:9081
       KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: BROKER:PLAINTEXT, CONTROLLER:PLAINTEXT, LOCALHOST:PLAINTEXT
       KAFKA_CFG_ADVERTISED_LISTENERS: BROKER://kafka-1:9092, LOCALHOST://localhost:9081
       KAFKA_BROKER_ID: 1
-      KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: 1@kafka-1:9093,2@kafka-2:9093,3@kafka-3:9093
+      KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: 0@kafka-0:9092
       ALLOW_PLAINTEXT_LISTENER: 'yes'
       KAFKA_CFG_INTER_BROKER_LISTENER_NAME: BROKER
       KAFKA_CFG_OFFSETS_TOPIC_REPLICATION_FACTOR: 3
@@ -24,13 +40,13 @@ services:
     environment:
       KAFKA_ENABLE_KRAFT: 'yes'
       KAFKA_KRAFT_CLUSTER_ID: r7dMBY60T16TrNCGeXniLw
-      KAFKA_CFG_PROCESS_ROLES: broker,controller
+      KAFKA_CFG_PROCESS_ROLES: broker
       KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER
-      KAFKA_CFG_LISTENERS: BROKER://:9092, CONTROLLER://:9093, LOCALHOST://:9082
+      KAFKA_CFG_LISTENERS: BROKER://:9092, LOCALHOST://:9082
       KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: BROKER:PLAINTEXT, CONTROLLER:PLAINTEXT, LOCALHOST:PLAINTEXT
       KAFKA_CFG_ADVERTISED_LISTENERS: BROKER://kafka-2:9092, LOCALHOST://localhost:9082
       KAFKA_BROKER_ID: 2
-      KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: 1@kafka-1:9093,2@kafka-2:9093,3@kafka-3:9093
+      KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: 0@kafka-0:9092
       ALLOW_PLAINTEXT_LISTENER: 'yes'
       KAFKA_CFG_INTER_BROKER_LISTENER_NAME: BROKER
       KAFKA_CFG_OFFSETS_TOPIC_REPLICATION_FACTOR: 3
@@ -48,13 +64,13 @@ services:
     environment:
       KAFKA_ENABLE_KRAFT: 'yes'
       KAFKA_KRAFT_CLUSTER_ID: r7dMBY60T16TrNCGeXniLw
-      KAFKA_CFG_PROCESS_ROLES: broker,controller
+      KAFKA_CFG_PROCESS_ROLES: broker
       KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER
-      KAFKA_CFG_LISTENERS: BROKER://:9092, CONTROLLER://:9093, LOCALHOST://:9083
+      KAFKA_CFG_LISTENERS: BROKER://:9092, LOCALHOST://:9083
       KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: BROKER:PLAINTEXT, CONTROLLER:PLAINTEXT, LOCALHOST:PLAINTEXT
       KAFKA_CFG_ADVERTISED_LISTENERS: BROKER://kafka-3:9092, LOCALHOST://localhost:9083
       KAFKA_BROKER_ID: 3
-      KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: 1@kafka-1:9093,2@kafka-2:9093,3@kafka-3:9093
+      KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: 0@kafka-0:9092
       ALLOW_PLAINTEXT_LISTENER: 'yes'
       KAFKA_CFG_INTER_BROKER_LISTENER_NAME: BROKER
       KAFKA_CFG_OFFSETS_TOPIC_REPLICATION_FACTOR: 3