-
-
Notifications
You must be signed in to change notification settings - Fork 201
/
docker-compose.yml
206 lines (186 loc) · 5.68 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
version: '3'
services:
## Router
router01:
image: mongo:latest
container_name: router-01
command: mongos --port 27017 --configdb rs-config-server/configsvr01:27017,configsvr02:27017,configsvr03:27017 --bind_ip_all
ports:
- "27117:27017"
restart: always
volumes:
- ./scripts:/scripts
- mongodb_cluster_router01_db:/data/db
- mongodb_cluster_router01_config:/data/configdb
router02:
image: mongo:latest
container_name: router-02
command: mongos --port 27017 --configdb rs-config-server/configsvr01:27017,configsvr02:27017,configsvr03:27017 --bind_ip_all
volumes:
- ./scripts:/scripts
- mongodb_cluster_router02_db:/data/db
- mongodb_cluster_router02_config:/data/configdb
ports:
- "27118:27017"
restart: always
links:
- router01
## Config Servers
configsvr01:
image: mongo:latest
container_name: mongo-config-01
command: mongod --port 27017 --configsvr --replSet rs-config-server
volumes:
- ./scripts:/scripts
- mongodb_cluster_configsvr01_db:/data/db
- mongodb_cluster_configsvr01_config:/data/configdb
restart: always
links:
- shard01-a
- shard02-a
- shard03-a
configsvr02:
image: mongo:latest
container_name: mongo-config-02
command: mongod --port 27017 --configsvr --replSet rs-config-server
volumes:
- ./scripts:/scripts
- mongodb_cluster_configsvr02_db:/data/db
- mongodb_cluster_configsvr02_config:/data/configdb
restart: always
links:
- configsvr01
configsvr03:
image: mongo:latest
container_name: mongo-config-03
command: mongod --port 27017 --configsvr --replSet rs-config-server
volumes:
- ./scripts:/scripts
- mongodb_cluster_configsvr03_db:/data/db
- mongodb_cluster_configsvr03_config:/data/configdb
restart: always
links:
- configsvr02
## Shards
## Shards 01
shard01-a:
image: mongo:latest
container_name: shard-01-node-a
command: mongod --port 27017 --shardsvr --replSet rs-shard-01
volumes:
- ./scripts:/scripts
- mongodb_cluster_shard01_a_db:/data/db
- mongodb_cluster_shard01_a_config:/data/configdb
restart: always
links:
- shard01-b
- shard01-c
shard01-b:
image: mongo:latest
container_name: shard-01-node-b
command: mongod --port 27017 --shardsvr --replSet rs-shard-01
volumes:
- ./scripts:/scripts
- mongodb_cluster_shard01_b_db:/data/db
- mongodb_cluster_shard01_b_config:/data/configdb
restart: always
shard01-c:
image: mongo:latest
container_name: shard-01-node-c
command: mongod --port 27017 --shardsvr --replSet rs-shard-01
volumes:
- ./scripts:/scripts
- mongodb_cluster_shard01_c_db:/data/db
- mongodb_cluster_shard01_c_config:/data/configdb
restart: always
## Shards 02
shard02-a:
image: mongo:latest
container_name: shard-02-node-a
command: mongod --port 27017 --shardsvr --replSet rs-shard-02
volumes:
- ./scripts:/scripts
- mongodb_cluster_shard02_a_db:/data/db
- mongodb_cluster_shard02_a_config:/data/configdb
restart: always
links:
- shard02-b
- shard02-c
shard02-b:
image: mongo:latest
container_name: shard-02-node-b
command: mongod --port 27017 --shardsvr --replSet rs-shard-02
volumes:
- ./scripts:/scripts
- mongodb_cluster_shard02_b_db:/data/db
- mongodb_cluster_shard02_b_config:/data/configdb
restart: always
shard02-c:
image: mongo:latest
container_name: shard-02-node-c
command: mongod --port 27017 --shardsvr --replSet rs-shard-02
volumes:
- ./scripts:/scripts
- mongodb_cluster_shard02_c_db:/data/db
- mongodb_cluster_shard02_c_config:/data/configdb
restart: always
## Shards 03
shard03-a:
image: mongo:latest
container_name: shard-03-node-a
command: mongod --port 27017 --shardsvr --replSet rs-shard-03
volumes:
- ./scripts:/scripts
- mongodb_cluster_shard03_a_db:/data/db
- mongodb_cluster_shard03_a_config:/data/configdb
restart: always
links:
- shard03-b
- shard03-c
shard03-b:
image: mongo:latest
container_name: shard-03-node-b
command: mongod --port 27017 --shardsvr --replSet rs-shard-03
volumes:
- ./scripts:/scripts
- mongodb_cluster_shard03_b_db:/data/db
- mongodb_cluster_shard03_b_config:/data/configdb
restart: always
shard03-c:
image: mongo:latest
container_name: shard-03-node-c
command: mongod --port 27017 --shardsvr --replSet rs-shard-03
volumes:
- ./scripts:/scripts
- mongodb_cluster_shard03_c_db:/data/db
- mongodb_cluster_shard03_c_config:/data/configdb
restart: always
volumes:
mongodb_cluster_router01_db:
mongodb_cluster_router01_config:
mongodb_cluster_router02_db:
mongodb_cluster_router02_config:
mongodb_cluster_configsvr01_db:
mongodb_cluster_configsvr01_config:
mongodb_cluster_configsvr02_db:
mongodb_cluster_configsvr02_config:
mongodb_cluster_configsvr03_db:
mongodb_cluster_configsvr03_config:
mongodb_cluster_shard01_a_db:
mongodb_cluster_shard01_a_config:
mongodb_cluster_shard01_b_db:
mongodb_cluster_shard01_b_config:
mongodb_cluster_shard01_c_db:
mongodb_cluster_shard01_c_config:
mongodb_cluster_shard02_a_db:
mongodb_cluster_shard02_a_config:
mongodb_cluster_shard02_b_db:
mongodb_cluster_shard02_b_config:
mongodb_cluster_shard02_c_db:
mongodb_cluster_shard02_c_config:
mongodb_cluster_shard03_a_db:
mongodb_cluster_shard03_a_config:
mongodb_cluster_shard03_b_db:
mongodb_cluster_shard03_b_config:
mongodb_cluster_shard03_c_db:
mongodb_cluster_shard03_c_config: