forked from delimitrou/DeathStarBench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-sharding.yml
339 lines (309 loc) · 8.87 KB
/
docker-compose-sharding.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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
# Docker-compose file for Redis/MongoDB/Memcached Sharding
# Currently only supports Redis
version: "3.9"
services:
social-graph-service:
image: deathstarbench/social-network-microservices:latest
hostname: social-graph-service
# ports:
# - 10000:9090
depends_on:
jaeger-agent:
condition: service_started
social-graph-mongodb:
condition: service_started
social-graph-redis-cluster-setup:
condition: service_completed_successfully
restart: always
entrypoint: SocialGraphService --redis-cluster
volumes:
- ./config:/social-network-microservices/config
social-graph-mongodb:
image: mongo:4.4.6
hostname: social-graph-mongodb
# ports:
# - 27018:27017
restart: always
social-graph-redis:
image: redis
hostname: social-graph-redis
deploy:
replicas: 5
# ports:
# - 6380:6379
restart: always
command: --port 6379 --cluster-config-file nodes.conf --cluster-enabled yes --cluster-node-timeout 5000 --save "" --appendonly no
# Setup for redis cluster
social-graph-redis-cluster-setup:
image: redis
depends_on:
social-graph-redis:
condition: service_started
volumes:
- ./scripts:/scripts
entrypoint: /bin/bash /scripts/setup_redis_cluster.sh -n social-graph-redis
home-timeline-redis:
image: redis
hostname: home-timeline-redis
deploy:
replicas: 5
# ports:
# - 6381:6379
restart: always
command: --port 6379 --cluster-config-file nodes.conf --cluster-enabled yes --cluster-node-timeout 5000 --save "" --appendonly no
# Setup for redis cluster
home-timeline-redis-cluster-setup:
image: redis
depends_on:
home-timeline-redis:
condition: service_started
volumes:
- ./scripts:/scripts
entrypoint: /bin/bash /scripts/setup_redis_cluster.sh -n home-timeline-redis
compose-post-service:
image: deathstarbench/social-network-microservices:latest
hostname: compose-post-service
# ports:
# - 10001:9090
restart: always
depends_on:
jaeger-agent:
condition: service_started
entrypoint: ComposePostService
volumes:
- ./config:/social-network-microservices/config
post-storage-service:
image: deathstarbench/social-network-microservices:latest
hostname: post-storage-service
# ports:
# - 10002:9090
restart: always
depends_on:
jaeger-agent:
condition: service_started
post-storage-mongodb:
condition: service_started
entrypoint: PostStorageService
volumes:
- ./config:/social-network-microservices/config
post-storage-memcached:
image: memcached
hostname: post-storage-memcached
# ports:
# - 11212:11211
restart: always
post-storage-mongodb:
image: mongo:4.4.6
hostname: post-storage-mongodb
# ports:
# - 27019:27017
restart: always
user-timeline-service:
image: deathstarbench/social-network-microservices:latest
hostname: user-timeline-service
# ports:
# - 10003:9090
restart: always
depends_on:
jaeger-agent:
condition: service_started
user-timeline-mongodb:
condition: service_started
user-timeline-redis-cluster-setup:
condition: service_completed_successfully
entrypoint: UserTimelineService --redis-cluster
volumes:
- ./config:/social-network-microservices/config
user-timeline-redis:
image: redis
hostname: user-timeline-redis
deploy:
replicas: 5
# ports:
# - 6383:6379
restart: always
command: --port 6379 --cluster-config-file nodes.conf --cluster-enabled yes --cluster-node-timeout 5000 --save "" --appendonly no
# Setup for redis cluster
user-timeline-redis-cluster-setup:
image: redis
depends_on:
user-timeline-redis:
condition: service_started
volumes:
- ./scripts:/scripts
entrypoint: /bin/bash /scripts/setup_redis_cluster.sh -n user-timeline-redis
user-timeline-mongodb:
image: mongo:4.4.6
hostname: user-timeline-mongodb
# ports:
# - 27020:27017
restart: always
url-shorten-service:
image: deathstarbench/social-network-microservices:latest
hostname: url-shorten-service
# ports:
# - 10004:9090
restart: always
entrypoint: UrlShortenService
depends_on:
jaeger-agent:
condition: service_started
url-shorten-mongodb:
condition: service_started
volumes:
- ./config:/social-network-microservices/config
url-shorten-memcached:
image: memcached
hostname: url-shorten-memcached
# ports:
# - 11213:11211
restart: always
url-shorten-mongodb:
image: mongo:4.4.6
hostname: url-shorten-mongodb
# ports:
# - 27021:27017
restart: always
user-service:
image: deathstarbench/social-network-microservices:latest
hostname: user-service
# ports:
# - 10005:9090
restart: always
depends_on:
jaeger-agent:
condition: service_started
user-mongodb:
condition: service_started
entrypoint: UserService
volumes:
- ./config:/social-network-microservices/config
user-memcached:
image: memcached
hostname: user-memcached
# ports:
# - 11214:11211
restart: always
user-mongodb:
image: mongo:4.4.6
hostname: user-mongodb
ports:
- 27023:27017
restart: always
media-service:
image: deathstarbench/social-network-microservices:latest
hostname: media-service
# ports:
# - 10006:9090
depends_on:
jaeger-agent:
condition: service_started
media-mongodb:
condition: service_started
restart: always
entrypoint: MediaService
volumes:
- ./config:/social-network-microservices/config
media-memcached:
image: memcached
hostname: media-memcached
# ports:
# - 11215:11211
restart: always
media-mongodb:
image: mongo:4.4.6
hostname: media-mongodb
# ports:
# - 27024:27017
restart: always
text-service:
image: deathstarbench/social-network-microservices:latest
hostname: text-service
# ports:
# - 10007:9090
restart: always
depends_on:
jaeger-agent:
condition: service_started
entrypoint: TextService
volumes:
- ./config:/social-network-microservices/config
unique-id-service:
image: deathstarbench/social-network-microservices:latest
hostname: unique-id-service
# ports:
# - 10008:9090
restart: always
depends_on:
jaeger-agent:
condition: service_started
entrypoint: UniqueIdService
volumes:
- ./config:/social-network-microservices/config
user-mention-service:
image: deathstarbench/social-network-microservices:latest
hostname: user-mention-service
# ports:
# - 10009:9090
depends_on:
jaeger-agent:
condition: service_started
restart: always
entrypoint: UserMentionService
volumes:
- ./config:/social-network-microservices/config
home-timeline-service:
image: deathstarbench/social-network-microservices:latest
hostname: home-timeline-service
# ports:
# - 10010:9090
depends_on:
jaeger-agent:
condition: service_started
home-timeline-redis-cluster-setup:
condition: service_completed_successfully
restart: always
entrypoint: HomeTimelineService --redis-cluster
volumes:
- ./config:/social-network-microservices/config
nginx-thrift:
image: yg397/openresty-thrift:xenial
hostname: nginx-thrift
ports:
- 8080:8080
depends_on:
jaeger-agent:
condition: service_started
restart: always
volumes:
- ./nginx-web-server/lua-scripts:/usr/local/openresty/nginx/lua-scripts
- ./nginx-web-server/pages:/usr/local/openresty/nginx/pages
- ./nginx-web-server/conf/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf
- ./nginx-web-server/jaeger-config.json:/usr/local/openresty/nginx/jaeger-config.json
- ./gen-lua:/gen-lua
- ./docker/openresty-thrift/lua-thrift:/usr/local/openresty/lualib/thrift
media-frontend:
image: yg397/media-frontend:xenial
hostname: media-frontend
ports:
- 8081:8080
restart: always
depends_on:
jaeger-agent:
condition: service_started
volumes:
- ./media-frontend/lua-scripts:/usr/local/openresty/nginx/lua-scripts
- ./media-frontend/conf/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf
jaeger-agent:
image: jaegertracing/all-in-one:latest
ports:
# - 5775:5775/udp
# - 6831:6831/udp
# - 6832:6832/udp
# - 5778:5778
- 16686:16686
# - 14268:14268
# - 9411:9411
restart: always
environment:
- COLLECTOR_ZIPKIN_HTTP_PORT=9411