Kafka

Kafka Kafka 需要配合 Zookeeper HOSTNAME IP node1 192.168.2.11 node2 192.168.2.12 Docker node1 docker-compose.yml services: zookeeper: image: zookeeper:3.7.2 container_name: zookeeper volumes: - /etc/localtime:/etc/localtime:ro - /opt/zookeeper/conf:/conf - /opt/zookeeper/data:/data - /opt/zookeeper/logs:/datalog environment: - TZ=Asia/Shanghai - ZOO_MY_ID=1 network_mode: host restart: always kafka: image: docker.io/bitnami/kafka:3.3.2 container_name: kafka volumes: - /etc/localtime:/etc/localtime - /opt/kafka/conf:/opt/bitnami/kafka/config - /mnt/da/kafka/data:/bitnami/kafka environment: - TZ=Asia/Shanghai - KAFKA_BROKER_ID=1 - KAFKA_CFG_LISTENERS=PLAINTEXT://:9091 - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://node-1:9091 - KAFKA_CFG_ZOOKEEPER_CONNECT=node-1:2181,node-2:2181 - ALLOW_PLAINTEXT_LISTENER=yes network_mode: host restart: always depends_on: - zookeeper 获取 zookeeper 配置...

July 25, 2024 · Kevin