From 740dce79a56a2c303bf9b02ca02d72b88b150a91 Mon Sep 17 00:00:00 2001 From: Cyril Roy Date: Wed, 21 Oct 2026 16:05:20 -0400 Subject: [PATCH] docker: update kafka and remove zookeeper --- services/README.md | 8 ++-- .../docker-compose-kafka-elastic-mongodb.yml | 37 ++++++------------- 2 files changed, 16 insertions(+), 29 deletions(-) diff --git a/services/README.md b/services/README.md index f02291efa8..1322fe117a 100644 --- a/services/README.md +++ b/services/README.md @@ -6,7 +6,7 @@ Modules in this directory include CS Studio/Phoebus middleware services: * Alarm Logger * Alarm Service * Archive Engine -* Save-and-Restore +* Save-and-Restore Additional middleware services are maintained in other repositories: * Phoebus Logbook Service (Olog): https://github.com/Olog/phoebus-olog @@ -20,9 +20,9 @@ Phoebus services depend: * Elasticsearch * Used by Save-and-Restore, Alarm Logger, Channel Finder and Olog -* MongoDB +* MongoDB * Used by Olog (see https://github.com/Olog/phoebus-olog) -* Kafka + Zookeeper +* Kafka * Used by Alarm Server and Alarm Logger To launch the docker compose file in this directory (and docker compose files in sub-directories), user @@ -43,7 +43,7 @@ MONGO_HOST_IP_ADDRESS= Where * ``````: the IP address where docker is launched. * ```/Accelerator.xml```: absolute path to the ```Accelerator.xml``` alarm config file. -* ```/settings.properties```: absolute path to the ```settings.properties``` file. +* ```/settings.properties```: absolute path to the ```settings.properties``` file. The ```settings.properties``` file is needed to define the default EPICS protocol like so: ```org.phoebus.pv/default=pva``` diff --git a/services/docker-compose-kafka-elastic-mongodb.yml b/services/docker-compose-kafka-elastic-mongodb.yml index 3e297ce42a..99a5a4907c 100644 --- a/services/docker-compose-kafka-elastic-mongodb.yml +++ b/services/docker-compose-kafka-elastic-mongodb.yml @@ -21,47 +21,34 @@ services: - mongodata:/etc/mongo - zookeeper: - image: confluentinc/cp-zookeeper:latest - hostname: zookeeper - healthcheck: - test: nc -z localhost 2181 || exit -1 - interval: 10s - timeout: 10s - retries: 3 - environment: - ZOOKEEPER_CLIENT_PORT: 2181 - ZOOKEEPER_TICK_TIME: 2000 - KAFKA_HEAP_OPTS: "-Xmx512M" - ports: - - 2181:2181 - kafka: - image: confluentinc/cp-kafka:latest + image: confluentinc/cp-kafka:8.3.2 hostname: kafka - depends_on: - zookeeper: - condition: service_healthy ports: - "9092:9092" - "29092:29092" environment: + CLUSTER_ID: OnFjIuViRfiRd9GdVjNEOg + KAFKA_NODE_ID: 1 + KAFKA_PROCESS_ROLES: broker,controller + KAFKA_CONTROLLER_QUORUM_VOTERS: 1@kafka:29093 + KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER + KAFKA_LISTENERS: INTERNAL://0.0.0.0:19092,EXTERNAL://0.0.0.0:9092,DOCKER://0.0.0.0:29092,CONTROLLER://kafka:29093 KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka:19092,EXTERNAL://${HOST_IP_ADDRESS}:9092,DOCKER://localhost:29092 - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT,DOCKER:PLAINTEXT + KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT,DOCKER:PLAINTEXT,CONTROLLER:PLAINTEXT + KAFKA_LOG_DIRS: /var/lib/kafka/data KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL - KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181" - KAFKA_BROKER_ID: 1 KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1 KAFKA_ALLOW_EVERYONE_IF_NO_ACL_FOUND: "true" KAFKA_HEAP_OPTS: "-Xmx1G" + volumes: + - kafka_data:/var/lib/kafka/data volumes: es-data: driver: local mongodata: driver: local - - - + kafka_data: