admin

docker-compose 单机部署kafka

admin docker技术 2024-04-11 240836浏览 0

docker-compose 单机部署kafka

version: "3"
services:
  zookeeper:
    image: swr.cn-east-2.myhuaweicloud.com/helowin/zookeeper:3.4.10
    container_name: zookeeper
    environment:
      - TZ=Asia/Shanghai
    ports:
      - "2181:2181"
    restart: always
  kafka:
    image: docker.io/bitnami/kafka:3.4
    container_name: kafka
    ports:
      - "9092:9092"
    volumes:
      - /home/kafka/data:/bitnami/kafka/data
    environment:
      - KAFKA_BROKER_ID=1
      - KAFKA_CFG_LISTENERS=PLAINTEXT://:9092
      - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://192.168.9.232:9092
      - KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
      - ALLOW_PLAINTEXT_LISTENER=yes
    depends_on:
      - zookeeper
  kafka-manager:
    image: sheepkiller/kafka-manager:latest
    container_name: kafka-manager
    ports:
      - "9000:9000"
    environment:
      ZK_HOSTS: zookeeper:2181
      APPLICATION_SECRET: letmein
      KAFKA_MANAGER_USERNAME: kafka
      KAFKA_MANAGER_PASSWORD: mhsj@123
      KM_ARGS: -Dhttp.port=9000


版权声明

本站《作品展示》类文章均为原创,转载必须注明出处,技术分享类文章部分来源于网络,版权归原作者所有,若侵权请留言。