标签搜索

docker-compose安装kafka

basil
2023-12-25 / 106 阅读
version: '3'
services:
  zookeeper:
    image: wurstmeister/zookeeper
    container_name: zookeeper1
    ports:
      - "2181:2181"
    environment:
      PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
      JAVA_HOME: /usr/lib/jvm/java-7-openjdk-amd64
      ZOOKEEPER_VERSION: 3.4.13
      ZK_HOME: /opt/zookeeper-3.4.13
  kafka:
    image: wurstmeister/kafka
    ports:
      - "8092:8092"
    volumes:
      - /www/docker/kafka/logs/kafka-logs:/kafka/kafka-logs
      - /etc/localtime:/etc/localtime
    environment:
      KAFKA_BROKER_ID: 0
      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://192.168.113.2:8092
      KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:8092
      PATH: /usr/local/openjdk-11/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/kafka/bin
      JAVA_HOME: /usr/local/openjdk-11
      JAVA_VERSION: 11.0.15
      KAFKA_VERSION: 2.8.1
      SCALA_VERSION: 2.13
      KAFKA_HOME: /opt/kafka
      KAFKA_LOG_DIRS: /kafka/kafka-logs
      LANG: C.UTF-8
    container_name: kafka1
    tty: true
    privileged: true
    stdin_open: true
0