This repository has been archived by the owner on May 31, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
docker-compose.yml
100 lines (94 loc) · 4.08 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
version: '2'
services:
# Config servers for metadata
mongo-configserver-01:
image: mongo
command: mongod --auth --port 27017 --configsvr --noprealloc --smallfiles --replSet mongo-configserver --dbpath /data/db --oplogSize 16 --keyFile /mongodb.key
volumes:
- ./mongodb.key:/mongodb.key
- ./mongo-configserver.init.js:/mongo-configserver.init.js
mongo-configserver-02:
image: mongo
command: mongod --auth --port 27017 --configsvr --noprealloc --smallfiles --replSet mongo-configserver --dbpath /data/db --oplogSize 16 --keyFile /mongodb.key
volumes:
- ./mongodb.key:/mongodb.key
mongo-configserver-03:
image: mongo
command: mongod --auth --port 27017 --configsvr --noprealloc --smallfiles --replSet mongo-configserver --dbpath /data/db --oplogSize 16 --keyFile /mongodb.key
volumes:
- ./mongodb.key:/mongodb.key
# First shard
mongo-shard-01a:
image: mongo
command: mongod --auth --port 27018 --noprealloc --smallfiles --replSet mongo-shard-01 --dbpath /data/db --nojournal --oplogSize 16 --keyFile /mongodb.key
volumes:
- ./mongodb.key:/mongodb.key
- ./mongo-shard-01.init.js:/mongo-shard-01.init.js
mongo-shard-01b:
image: mongo
command: mongod --auth --port 27018 --noprealloc --smallfiles --replSet mongo-shard-01 --dbpath /data/db --nojournal --oplogSize 16 --keyFile /mongodb.key
volumes:
- ./mongodb.key:/mongodb.key
mongo-shard-01c:
image: mongo
command: mongod --auth --port 27018 --noprealloc --smallfiles --replSet mongo-shard-01 --dbpath /data/db --nojournal --oplogSize 16 --keyFile /mongodb.key
volumes:
- ./mongodb.key:/mongodb.key
# Second shard
mongo-shard-02a:
image: mongo
command: mongod --auth --port 27019 --noprealloc --smallfiles --replSet mongo-shard-02 --dbpath /data/db --nojournal --oplogSize 16 --keyFile /mongodb.key
volumes:
- ./mongodb.key:/mongodb.key
- ./mongo-shard-02.init.js:/mongo-shard-02.init.js
mongo-shard-02b:
image: mongo
command: mongod --auth --port 27019 --noprealloc --smallfiles --replSet mongo-shard-02 --dbpath /data/db --nojournal --oplogSize 16 --keyFile /mongodb.key
volumes:
- ./mongodb.key:/mongodb.key
mongo-shard-02c:
image: mongo
command: mongod --auth --port 27019 --noprealloc --smallfiles --replSet mongo-shard-02 --dbpath /data/db --nojournal --oplogSize 16 --keyFile /mongodb.key
volumes:
- ./mongodb.key:/mongodb.key
# Third shard
mongo-shard-03a:
image: mongo
command: mongod --auth --port 27020 --noprealloc --smallfiles --replSet mongo-shard-03 --dbpath /data/db --nojournal --oplogSize 16 --keyFile /mongodb.key
volumes:
- ./mongodb.key:/mongodb.key
- ./mongo-shard-03.init.js:/mongo-shard-03.init.js
mongo-shard-03b:
image: mongo
command: mongod --auth --port 27020 --noprealloc --smallfiles --replSet mongo-shard-03 --dbpath /data/db --nojournal --oplogSize 16 --keyFile /mongodb.key
volumes:
- ./mongodb.key:/mongodb.key
mongo-shard-03c:
image: mongo
command: mongod --auth --port 27020 --noprealloc --smallfiles --replSet mongo-shard-03 --dbpath /data/db --nojournal --oplogSize 16 --keyFile /mongodb.key
volumes:
- ./mongodb.key:/mongodb.key
# Mongo router
mongo-router-01:
image: mongo
command: mongos --port 27017 --configdb mongo-configserver/mongo-configserver-01:27017,mongo-configserver-02:27017,mongo-configserver-03:27017 --keyFile /mongodb.key
volumes:
- ./mongodb.key:/mongodb.key
- ./mongo-sharding.init.js:/mongo-sharding.init.js
- ./mongo-auth.init.js:/mongo-auth.init.js
# Can be useful if you need to access it from your current host within Robomongo or some other clients
#ports:
# - "27017:27017"
depends_on:
- mongo-configserver-01
- mongo-configserver-02
- mongo-configserver-03
- mongo-shard-01a
- mongo-shard-01b
- mongo-shard-01c
- mongo-shard-02a
- mongo-shard-02b
- mongo-shard-02c
- mongo-shard-03a
- mongo-shard-03b
- mongo-shard-03c