kafka

回覆文章
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

kafka

文章 yehlu »

https://cutejaneii.wordpress.com/2017/0 ... %E4%B8%8A/

代碼: 選擇全部

version: '2'
services:
 kafka1:
  image: wurstmeister/kafka
  depends_on:
  - zoo1
  - zoo2
  - zoo3
  ports:
  - "9092:9092"
  environment:
    KAFKA_LOG_DIRS: /kafka
    KAFKA_BROKER_ID: 1
    KAFKA_CREATE_TOPICS: test:6:1
    KAFKA_ADVERTISED_HOST_NAME: 192.168.0.1
    KAFKA_ADVERTISED_PORT: 9092
    KAFKA_ZOOKEEPER_CONNECT: zoo1:2181,zoo2:2181,zoo3:2181

 kafka2:
  image: wurstmeister/kafka
  depends_on:
  - zoo1
  - zoo2
  - zoo3
  ports:
  - "9093:9092"
  environment:
    KAFKA_LOG_DIRS: /kafka
    KAFKA_BROKER_ID: 2
    KAFKA_ADVERTISED_HOST_NAME: 192.168.0.1
    KAFKA_ADVERTISED_PORT: 9093
    KAFKA_ZOOKEEPER_CONNECT: zoo1:2181,zoo2:2181,zoo3:2181

 kafka3:
  image: wurstmeister/kafka
  depends_on:
  - zoo1
  - zoo2
  - zoo3
  ports:
  - "9094:9092"
  environment:
    KAFKA_LOG_DIRS: /kafka
    KAFKA_BROKER_ID: 3
    KAFKA_ADVERTISED_HOST_NAME: 192.168.0.1
    KAFKA_ADVERTISED_PORT: 9094
    KAFKA_ZOOKEEPER_CONNECT: zoo1:2181,zoo2:2181,zoo3:2181

 zoo1:
  image: zookeeper:latest
  environment:
    ZOO_MY_ID: 1
  #SERVERS: zoo1,zoo2,zoo3
  ports:
  - "2181:2181"
  - "2888"
  - "3888"

 zoo2:
  image: zookeeper:latest
  environment:
    ZOO_MY_ID: 2
  #SERVERS: zoo1,zoo2,zoo3
  ports:
  - "2182:2181"
  - "2888"
  - "3888"
 
 zoo3:
  image: zookeeper:latest
  environment:
    ZOO_MY_ID: 3
  #SERVERS: zoo1,zoo2,zoo3
  ports:
  - "2183:2181"
  - "2888"
  - "3888"
附加檔案
docker-compose.yml.zip
(518 Bytes) 已下載 97 次
回覆文章

回到「Docker」