Expliziten Listener für Broker eingeführt (BROKER: Broker, DOCKER: user)
authorKai Moritz <kai@juplo.de>
Wed, 11 Oct 2023 16:31:53 +0000 (18:31 +0200)
committerKai Moritz <kai@juplo.de>
Mon, 16 Oct 2023 20:40:04 +0000 (22:40 +0200)
docker/docker-compose.yml

index e2e4891..1239f56 100644 (file)
@@ -14,9 +14,9 @@ services:
     image: confluentinc/cp-kafka:7.5.1
     environment:
       KAFKA_ZOOKEEPER_CONNECT: zookeeper: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
+      KAFKA_LISTENERS: BROKER://:9091, DOCKER://:9092, LOCALHOST://:9081
+      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: BROKER:PLAINTEXT, DOCKER:PLAINTEXT, LOCALHOST:PLAINTEXT
+      KAFKA_ADVERTISED_LISTENERS: BROKER://kafka-1:9091, DOCKER://kafka-1:9092, LOCALHOST://localhost:9081
       KAFKA_BROKER_ID: 1
       KAFKA_INTER_BROKER_LISTENER_NAME: BROKER
       KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 3
@@ -44,9 +44,9 @@ services:
     image: confluentinc/cp-kafka:7.5.1
     environment:
       KAFKA_ZOOKEEPER_CONNECT: zookeeper: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_LISTENERS: BROKER://:9091, DOCKER://:9092, LOCALHOST://:9082
+      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: BROKER:PLAINTEXT, DOCKER:PLAINTEXT, LOCALHOST:PLAINTEXT
+      KAFKA_ADVERTISED_LISTENERS: BROKER://kafka-2:9091, DOCKER://kafka-2:9092, LOCALHOST://localhost:9082
       KAFKA_BROKER_ID: 2
       KAFKA_INTER_BROKER_LISTENER_NAME: BROKER
       KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 3
@@ -79,9 +79,9 @@ services:
     image: confluentinc/cp-kafka:7.5.1
     environment:
       KAFKA_ZOOKEEPER_CONNECT: zookeeper: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
+      KAFKA_LISTENERS: BROKER://:9091, DOCKER://:9092, LOCALHOST://:9083
+      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: BROKER:PLAINTEXT, DOCKER:PLAINTEXT, LOCALHOST:PLAINTEXT
+      KAFKA_ADVERTISED_LISTENERS: BROKER://kafka-3:9091, DOCKER://kafka-3:9092, LOCALHOST://localhost:9083
       KAFKA_BROKER_ID: 3
       KAFKA_INTER_BROKER_LISTENER_NAME: BROKER
       KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 3
@@ -109,9 +109,9 @@ services:
     image: confluentinc/cp-kafka:7.5.1
     environment:
       KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
-      KAFKA_LISTENERS: BROKER://:9092, LOCALHOST://:9084
-      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: BROKER:PLAINTEXT, LOCALHOST:PLAINTEXT
-      KAFKA_ADVERTISED_LISTENERS: BROKER://kafka-4:9092, LOCALHOST://localhost:9084
+      KAFKA_LISTENERS: BROKER://:9091, DOCKER://:9092, LOCALHOST://:9084
+      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: BROKER:PLAINTEXT, DOCKER:PLAINTEXT, LOCALHOST:PLAINTEXT
+      KAFKA_ADVERTISED_LISTENERS: BROKER://kafka-4:9091, DOCKER://kafka-4:9092, LOCALHOST://localhost:9084
       KAFKA_BROKER_ID: 4
       KAFKA_INTER_BROKER_LISTENER_NAME: BROKER
       KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 3
@@ -138,7 +138,7 @@ services:
   cruise-control:
     image: juplo/cruise-control
     environment:
-      BOOTSTRAP_SERVERS: kafka-1:9092,kafka-2:9092,kafka-3:9092
+      BOOTSTRAP_SERVERS: kafka-1:9091,kafka-2:9091,kafka-3:9091
       ZOOKEEPER_CONNECT: zookeeper:2181/
     ports:
       - "9090:9090"
@@ -146,7 +146,7 @@ services:
   schema-registry:
     image: confluentinc/cp-schema-registry:7.5.1
     environment:
-      SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: kafka-1:9092,kafka-2:9092,kafka-3:9092
+      SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: kafka-1:9091,kafka-2:9091,kafka-3:9091
       SCHEMA_REGISTRY_HOST_NAME: schema-registry
       SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:8085
       SCHEMA_REGISTRY_LOG4J_ROOT_LOGLEVEL: INFO
@@ -160,7 +160,7 @@ services:
   connect:
     image: confluentinc/cp-kafka-connect:7.5.1
     environment:
-      CONNECT_BOOTSTRAP_SERVERS: kafka-1:9092,kafka-2:9092,kafka-3:9092
+      CONNECT_BOOTSTRAP_SERVERS: kafka-1:9091,kafka-2:9091,kafka-3:9091
       CONNECT_REST_PORT: 8083
       CONNECT_REST_LISTENERS: http://0.0.0.0:8083
       CONNECT_REST_ADVERTISED_HOST_NAME: connect
@@ -200,38 +200,38 @@ services:
       - bash
       - -c
       - |
-        cub kafka-ready -b kafka-1:9092,kafka-2:9092,kafka-3:9092 3 60 > /dev/null 2>&1 || exit 1
+        cub kafka-ready -b kafka-1:9091,kafka-2:9091,kafka-3:9091 3 60 > /dev/null 2>&1 || exit 1
         if [ -e INITIALIZED ]
         then
           echo -n Bereits konfiguriert: 
           cat INITIALIZED
-          kafka-topics --bootstrap-server kafka:9092 --describe --topic test
-          kafka-topics --bootstrap-server kafka:9092 --describe --topic __CruiseControlMetrics
+          kafka-topics --bootstrap-server kafka:9091 --describe --topic test
+          kafka-topics --bootstrap-server kafka:9091 --describe --topic __CruiseControlMetrics
         else
-          kafka-topics --bootstrap-server kafka:9092 \
+          kafka-topics --bootstrap-server kafka:9091 \
                        --delete \
                        --if-exists \
                        --topic test
-          kafka-topics --bootstrap-server kafka:9092 \
+          kafka-topics --bootstrap-server kafka:9091 \
                        --create \
                        --topic test \
                        --partitions 2 \
                        --replication-factor 3 \
                        --config min.insync.replicas=2 \
           && echo Das Topic \'test\' wurde erfolgreich angelegt: \
-          && kafka-topics --bootstrap-server kafka:9092 --describe --topic test
-          kafka-topics --bootstrap-server kafka:9092 \
+          && kafka-topics --bootstrap-server kafka:9091 --describe --topic test
+          kafka-topics --bootstrap-server kafka:9091 \
                        --delete \
                        --if-exists \
                        --topic __CruiseControlMetrics
-          kafka-topics --bootstrap-server kafka:9092 \
+          kafka-topics --bootstrap-server kafka:9091 \
                        --create \
                        --topic __CruiseControlMetrics \
                        --partitions 2 \
                        --replication-factor 3 \
                        --config min.insync.replicas=2 \
           && echo Das Topic \'__CruiseControlMetrics\' wurde erfolgreich angelegt: \
-          && kafka-topics --bootstrap-server kafka:9092 --describe --topic __CruiseControlMetrics
+          && kafka-topics --bootstrap-server kafka:9091 --describe --topic __CruiseControlMetrics
         fi \
         && date > INITIALIZED
     stop_grace_period: 0s
@@ -260,7 +260,7 @@ services:
           connections:
             docker-kafka-server:
               properties:
-                bootstrap.servers: "kafka:9092"
+                bootstrap.servers: "kafka:9091"
               schema-registry:
                 url: "http://schema-registry:8085"
               connect: