Untitled - MARKUP 1.87 KB
                    
             version: '3.1'

volumes:  
  volume-data-kafka:

services:
  zookeeper-1:
    image: zookeeper
    ports:
      - 2181:2181
      - 8080:8080
    environment:
      ZOO_MY_ID: 1
      ZOO_SERVERS: server.1=0.0.0.0:2888:3888;2181 server.2=zookeeper-2:2888:3888;2181 server.3=zookeeper-3:2888:3888;2181
  zookeeper-2:
    image: zookeeper
    ports:
      - 2182:2181
    environment:
      ZOO_MY_ID: 2
      ZOO_SERVERS: server.1=zookeeper-1:2888:3888;2181 server.2=0.0.0.0:2888:3888;2181 server.3=zookeeper-3:2888:3888;2181
  zookeeper-3:
    image: zookeeper
    ports:
      - 2183:2181
    environment:
      ZOO_MY_ID: 3
      ZOO_SERVERS: server.1=zookeeper-1:2888:3888;2181 server.2=zookeeper-2:2888:3888;2181 server.3=0.0.0.0:2888:3888;2181
  kafka:
    image: wurstmeister/kafka
    ports:
      - "9092:9092"
    deploy:
      mode: global
    environment:
      KAFKA_ADVERTISED_PORT: "9092"
      KAFKA_DEFAULT_REPLICATION_FACTOR: "3"
      KAFKA_LOG_RETENTION_HOURS: "24"
      KAFKA_LISTENERS: "PLAINTEXT://:9092"
      KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
      KAFKA_DELETE_TOPIC_ENABLE: "true"
      KAFKA_MESSAGE_MAX_BYTES: "2000000"
      KAFKA_ZOOKEEPER_CONNECT: "zookeeper-1:2181,zookeeper-2:2181,zookeeper-3:2181"
      KAFKA_JMX_OPTS: "-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=127.0.0.1 -Dcom.sun.management.jmxremote.rmi.port=1099"
      JMX_PORT: 1099
    volumes:
      - volume-data-kafka:/data
  manager:
    image: kafkamanager/kafka-manager
    environment:
      ZK_HOSTS: "zookeeper-1:2181,zookeeper-2:2181,zookeeper-3:2181"
    ports: 
      - "9001:9000"
            
            

Paste Hosted With By PutCode