-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
110 lines (103 loc) · 3.34 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
version: '3'
services:
# Zookeeper
zookeeper:
image: wurstmeister/zookeeper:latest
volumes:
- $PWD/data/zookeeper/data:/opt/zookeeper-3.4.13/data
networks:
custom:
ipv4_address: ${DOCKER_NETWORK_SUBNET_PRAEFIX}.2
# Kafka Manager (WebUI)
manager:
image: hlebalbau/kafka-manager:2.0.0.2
command: -Dpidfile.path=/dev/null
expose:
- 9000
environment:
ZK_HOSTS: "zookeeper:2181"
APPLICATION_SECRET: "ad1b66e5-fb47-42ba-8f7a-9312e9b428ea"
depends_on:
- zookeeper
networks:
custom:
ipv4_address: ${DOCKER_NETWORK_SUBNET_PRAEFIX}.3
# Kafka Broker 1
broker1:
image: wurstmeister/kafka:2.12-2.3.0
hostname: broker1
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- $PWD/data/broker1:/kafka
expose:
- 9092
- 9094
- 1099
environment:
KAFKA_ADVERTISED_HOST_NAME: broker1
KAFKA_ADVERTISED_PORT: 9092
KAFKA_BROKER_ID: 1
KAFKA_LOG_DIRS: /kafka/kafka-logs-1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'false'
KAFKA_JMX_OPTS: "-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=broker1 -Dcom.sun.management.jmxremote.rmi.port=1099"
JMX_PORT: 1099
depends_on:
- zookeeper
networks:
custom:
ipv4_address: ${DOCKER_NETWORK_SUBNET_PRAEFIX}.4
# Kafka Broker 2
broker2:
image: wurstmeister/kafka:2.12-2.3.0
hostname: broker2
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- $PWD/data/broker2:/kafka
expose:
- 9092
- 9094
- 1099
environment:
KAFKA_ADVERTISED_HOST_NAME: broker2
KAFKA_ADVERTISED_PORT: 9092
KAFKA_BROKER_ID: 2
KAFKA_LOG_DIRS: /kafka/kafka-logs-2
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'false'
KAFKA_JMX_OPTS: "-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=broker2 -Dcom.sun.management.jmxremote.rmi.port=1099"
JMX_PORT: 1099
depends_on:
- zookeeper
networks:
custom:
ipv4_address: ${DOCKER_NETWORK_SUBNET_PRAEFIX}.5
# Kafka Broker 3
broker3:
image: wurstmeister/kafka:2.12-2.3.0
hostname: broker3
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- $PWD/data/broker3:/kafka
expose:
- 9092
- 9094
- 1099
environment:
KAFKA_ADVERTISED_HOST_NAME: broker3
KAFKA_ADVERTISED_PORT: 9092
KAFKA_BROKER_ID: 3
KAFKA_LOG_DIRS: /kafka/kafka-logs-3
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'false'
KAFKA_JMX_OPTS: "-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=broker3 -Dcom.sun.management.jmxremote.rmi.port=1099"
JMX_PORT: 1099
depends_on:
- zookeeper
networks:
custom:
ipv4_address: ${DOCKER_NETWORK_SUBNET_PRAEFIX}.6
networks:
custom:
external:
name: ${DOCKER_NETWORK}