-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
274 lines (255 loc) · 8.42 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
services:
spark_master:
image: bitnami/spark:3.5.1
container_name: spark_master_one
ports:
- "8190:8080"
- "7077:7077"
environment:
SPARK_UI_PORT: 8080
SPARK_MODE: master
SPARK_RPC_AUTHENTICATION_ENABLED: no
SPARK_RPC_ENCRYPTION_ENABLED: no
SPARK_LOCAL_STORAGE_ENCRYPTION_ENABLED: no
SPARK_SSL_ENABLED: no
networks:
dashboard_one:
ipv4_address: 172.30.0.2
spark_worker-1:
build: ./spark/sales
container_name: spark_worker-1_one
depends_on:
- cassandra
- spark_master
- init-cassandra
environment:
SPARK_MODE: worker
SPARK_MASTER_URL: spark://172.30.0.2:7077
SPARK_WORKER_CORES: 1
SPARK_WORKER_MEMORY: 512m
SPARK_DRIVER_MEMORY: 1G
SPARK_EXECUTOR_MEMORY: 512m
SPARK_RPC_AUTHENTICATION_ENABLED: no
SPARK_RPC_ENCRYPTION_ENABLED: no
SPARK_LOCAL_STORAGE_ENCRYPTION_ENABLED: no
SPARK_SSL_ENABLED: no
networks:
dashboard_one:
ipv4_address: 172.30.0.3
spark_worker-2:
build: ./spark/warehouse
container_name: spark_worker-2_one
depends_on:
- cassandra
- spark_master
- init-cassandra
environment:
SPARK_MODE: worker
SPARK_MASTER_URL: spark://172.30.0.2:7077
SPARK_WORKER_CORES: 1
SPARK_WORKER_MEMORY: 512m
SPARK_DRIVER_MEMORY: 1G
SPARK_EXECUTOR_MEMORY: 512m
SPARK_RPC_AUTHENTICATION_ENABLED: no
SPARK_RPC_ENCRYPTION_ENABLED: no
SPARK_LOCAL_STORAGE_ENCRYPTION_ENABLED: no
SPARK_SSL_ENABLED: no
networks:
dashboard_one:
ipv4_address: 172.30.0.4
controller-1:
image: confluentinc/cp-kafka:7.5.0
container_name: controller-1_one
environment:
KAFKA_NODE_ID: 1
KAFKA_PROCESS_ROLES: controller
KAFKA_CONTROLLER_QUORUM_VOTERS: "[email protected]:29092,[email protected]:29092,[email protected]:29092"
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT
KAFKA_LISTENERS: CONTROLLER://172.30.0.5:29092
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LOG_DIRS: "/tmp/data"
CLUSTER_ID: "MkU3OEVBNTcwNTJENDM2Qk"
networks:
dashboard_one:
ipv4_address: 172.30.0.5
controller-2:
image: confluentinc/cp-kafka:7.5.0
container_name: controller-2_one
environment:
KAFKA_NODE_ID: 2
KAFKA_PROCESS_ROLES: controller
KAFKA_CONTROLLER_QUORUM_VOTERS: "[email protected]:29092,[email protected]:29092,[email protected]:29092"
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT
KAFKA_LISTENERS: CONTROLLER://172.30.0.6:29092
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LOG_DIRS: "/tmp/data"
CLUSTER_ID: "MkU3OEVBNTcwNTJENDM2Qk"
networks:
dashboard_one:
ipv4_address: 172.30.0.6
controller-3:
image: confluentinc/cp-kafka:7.5.0
container_name: controller-3_one
environment:
KAFKA_NODE_ID: 3
KAFKA_PROCESS_ROLES: controller
KAFKA_CONTROLLER_QUORUM_VOTERS: "[email protected]:29092,[email protected]:29092,[email protected]:29092"
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT
KAFKA_LISTENERS: CONTROLLER://172.30.0.7:29092
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LOG_DIRS: "/tmp/data"
CLUSTER_ID: "MkU3OEVBNTcwNTJENDM2Qk"
networks:
dashboard_one:
ipv4_address: 172.30.0.7
broker-1:
image: confluentinc/cp-kafka:7.5.0
container_name: broker-1_one
ports:
- "9092:9092"
- "29092:29092"
depends_on:
- controller-1
- controller-2
- controller-3
environment:
KAFKA_BROKER_ID: 4
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT"
KAFKA_LISTENERS: PLAINTEXT://172.30.0.8:9092,PLAINTEXT_HOST://0.0.0.0:29092
KAFKA_CONTROLLER_QUORUM_VOTERS: "[email protected]:29092,[email protected]:29092,[email protected]:29092"
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://172.30.0.8:9092,PLAINTEXT_HOST://localhost:29092
KAFKA_LOG_DIRS: "/tmp/data"
KAFKA_PROCESS_ROLES: broker
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LOG_RETENTION_MS: 86400000 # 1 day in milliseconds
KAFKA_LOG_CLEANUP_POLICY: delete
CLUSTER_ID: "MkU3OEVBNTcwNTJENDM2Qk"
networks:
dashboard_one:
ipv4_address: 172.30.0.8
broker-2:
image: confluentinc/cp-kafka:7.5.0
container_name: broker-2_one
ports:
- "9093:9092"
- "29093:29093"
depends_on:
- controller-1
- controller-2
- controller-3
environment:
KAFKA_BROKER_ID: 5
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT"
KAFKA_LISTENERS: PLAINTEXT://172.30.0.9:9092,PLAINTEXT_HOST://0.0.0.0:29093
KAFKA_CONTROLLER_QUORUM_VOTERS: "[email protected]:29092,[email protected]:29092,[email protected]:29092"
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://172.30.0.9:9092,PLAINTEXT_HOST://localhost:29093
KAFKA_LOG_DIRS: "/tmp/data"
KAFKA_PROCESS_ROLES: broker
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LOG_RETENTION_MS: 86400000 # 1 day in milliseconds
KAFKA_LOG_CLEANUP_POLICY: delete
CLUSTER_ID: "MkU3OEVBNTcwNTJENDM2Qk"
networks:
dashboard_one:
ipv4_address: 172.30.0.9
broker-3:
image: confluentinc/cp-kafka:7.5.0
container_name: broker-3_one
ports:
- "9094:9092"
- "29094:29094"
depends_on:
- controller-1
- controller-2
- controller-3
environment:
KAFKA_BROKER_ID: 6
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT"
KAFKA_LISTENERS: PLAINTEXT://172.30.0.10:9092,PLAINTEXT_HOST://0.0.0.0:29094
KAFKA_CONTROLLER_QUORUM_VOTERS: "[email protected]:29092,[email protected]:29092,[email protected]:29092"
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://172.30.0.10:9092,PLAINTEXT_HOST://localhost:29094
KAFKA_LOG_DIRS: "/tmp/data"
KAFKA_PROCESS_ROLES: broker
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LOG_RETENTION_MS: 86400000 # 1 day in milliseconds
KAFKA_LOG_CLEANUP_POLICY: delete
CLUSTER_ID: "MkU3OEVBNTcwNTJENDM2Qk"
networks:
dashboard_one:
ipv4_address: 172.30.0.10
cassandra:
image: bitnami/cassandra:4.1.5
container_name: cassandra_one
hostname: cassandra_one
environment:
CASSANDRA_START_RPC: true
CASSANDRA_CLUSTER_NAME: cassandra_dashboard_one
ports:
- '9042:9042'
volumes:
- cassandra_data:/var/libs/cassandra
- cassandra_logs:/var/log/cassandra
networks:
dashboard_one:
ipv4_address: 172.30.0.11
api_python:
build: ./api
container_name: api_one
hostname: api_one
depends_on:
- broker-1
- broker-2
- broker-3
networks:
dashboard_one:
ipv4_address: 172.30.0.12
# dashboard:
# build: ./dashboard
# container_name: dashboard_one
# hostname: dashboard_one
# networks:
# dashboard_one:
# ipv4_address: 172.30.0.13
init-kafka:
image: confluentinc/cp-kafka:7.5.0
container_name: init-topics_one
depends_on:
- broker-1
- broker-2
- broker-3
networks:
dashboard_one:
ipv4_address: 172.30.0.14
entrypoint: [ '/bin/sh', '-c' ]
command: |
"
# blocks until kafka is reachable
/bin/kafka-topics --bootstrap-server 172.30.0.8:9092,172.30.0.9:9092,172.30.0.10:9092 --list
echo -e 'Creating kafka topics'
/bin/kafka-topics --create --topic sales --bootstrap-server 172.30.0.8:9092,172.30.0.9:9092,172.30.0.10:9092 --partitions 3 --replication-factor 3
/bin/kafka-topics --create --topic warehouse --bootstrap-server 172.30.0.8:9092,172.30.0.9:9092,172.30.0.10:9092 --partitions 3 --replication-factor 3
echo -e 'Successfully created the following topics:'
/bin/kafka-topics --bootstrap-server 172.30.0.8:9092,172.30.0.9:9092,172.30.0.10:9092 --list
"
init-cassandra:
build: ./cassandra/init-cassandra
container_name: init-cassandra_one
hostname: init-cassandra_one
depends_on:
- cassandra
networks:
dashboard_one:
ipv4_address: 172.30.0.15
volumes:
cassandra_data: {}
cassandra_logs: {}
networks:
dashboard_one:
driver: bridge
ipam:
driver: default
config:
- subnet: "172.30.0.0/16"