docker-compose 部署 KAFKA

version: '3'
services:
    zookepper:
      image: wurstmeister/zookeeper
      container_name: zookeeper
      restart: always
      volumes:
        - "/etc/localtime:/etc/localtime"
        - /usr/local/zookeeper/data:/opt/zookeeper-3.4.13/data
      ports:
        - "12181:2181"

    kafka:
      image: wurstmeister/kafka
      container_name: kafka
      restart: always
      volumes:
        - "/etc/localtime:/etc/localtime"
        - /var/run/docker.sock:/var/run/docker.sock
        - /usr/local/kafka/logs:/kafka/kafka-logs-1
      environment:
        KAFKA_BROKER_ID: 0
        KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://公网IP:19092
        KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:19092
        KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
        KAFKA_NUM_PARTITIONS: 3
        KAFKA_LOG_DIRS: /kafka/kafka-logs-1
        KAFKA_LOG_RETENTION_HOURS: 168
      ports:
        - "19092:19092"
      depends_on:
        - zookepper

    kafka-manager:
      image: sheepkiller/kafka-manager
      container_name: kafka-manager
      restart: always
      environment:
          ZK_HOSTS: zookeeper:2181
          KM_USERNAME: "admin"
          KM_PASSWORD: "123456"
      ports:
            - "19000:9000"
      depends_on:
          - kafka

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×