From 67fe5fdcd32b185f08c75b5f77ec9753785d4f63 Mon Sep 17 00:00:00 2001 From: Conor Mongey Date: Fri, 9 Aug 2024 23:42:15 +0100 Subject: [PATCH] wip --- Dockerfile.kafka | 4 ++-- docker-compose.yaml | 26 +++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/Dockerfile.kafka b/Dockerfile.kafka index 6e258f89..29ea72f9 100644 --- a/Dockerfile.kafka +++ b/Dockerfile.kafka @@ -10,13 +10,13 @@ ENV KAFKA_BROKER_ID=$broker_id ENV KAFKA_NODE_ID=$broker_id ENV KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 ENV KAFKA_PROCESS_ROLES='broker,controller' -ENV KAFKA_CONTROLLER_QUORUM_VOTERS=$broker_id@$listener_host:9093 +ENV KAFKA_CONTROLLER_QUORUM_VOTERS=1@kafka1:9093 ENV KAFKA_CONTROLLER_LISTENER_NAMES='CONTROLLER' # confluent's bash script looks for an 'SSL' suffix in listener names: # https://github.com/confluentinc/cp-docker-images/blob/76d786d0243ea16626b8b46dba34ec0b1066de84/debian/kafka/include/etc/confluent/docker/configure#L65 -ENV KAFKA_LISTENERS=INTERNAL_SSL://$listener_host:9090,EXTERNAL_SSL://$listener_host:9092,CONTROLLER://$listener_host:9093 +ENV KAFKA_LISTENERS=INTERNAL_SSL://$listener_host:9090,EXTERNAL_SSL://$listener_host:9092 ENV KAFKA_ADVERTISED_LISTENERS=INTERNAL_SSL://$listener_host:9090,EXTERNAL_SSL://localhost:$listener_port ENV KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=INTERNAL_SSL:SSL,EXTERNAL_SSL:SSL,CONTROLLER:PLAINTEXT ENV KAFKA_INTER_BROKER_LISTENER_NAME=INTERNAL_SSL diff --git a/docker-compose.yaml b/docker-compose.yaml index 0890c2a8..46a90eac 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -9,6 +9,30 @@ services: broker_id: 1 listener_host: kafka1 listener_port: 9092 + environment: + CLUSTER_ID: "MkU3OEVBNTcwNTJENDM2Qk" + KAFKA_LISTENERS: INTERNAL_SSL://kafka1:9090,EXTERNAL_SSL://kafka1:9092,CONTROLLER://kafka1:9093 ports: - "9092:9092" - - "9093:9093" + kafka2: + build: + context: . + dockerfile: Dockerfile.kafka + args: + broker_id: 2 + listener_host: kafka2 + listener_port: 9092 + environment: + CLUSTER_ID: "MkU3OEVBNTcwNTJENDM2Qk" + KAFKA_PROCESS_ROLES: broker + kafka3: + build: + context: . + dockerfile: Dockerfile.kafka + args: + broker_id: 3 + listener_host: kafka3 + listener_port: 9092 + environment: + CLUSTER_ID: "MkU3OEVBNTcwNTJENDM2Qk" + KAFKA_PROCESS_ROLES: broker