-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdocker-compose-test.yaml
170 lines (158 loc) · 3.36 KB
/
docker-compose-test.yaml
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
version: '3'
services:
# Router
## router 01
router01:
build:
context: .
dockerfile: .docker/router.dockerfile
container_name: router-01
ports:
- 27117:27017
volumes:
- ./scripts:/scripts
## router 02
router02:
build:
context: .
dockerfile: .docker/router.dockerfile
container_name: router-02
volumes:
- ./scripts:/scripts
ports:
- 27118:27017
links:
- router01
# Config Servers
## Config server 01
configsvr01:
build:
context: .
dockerfile: .docker/configserver.dockerfile
container_name: mongo-config-01
volumes:
- ./scripts:/scripts
ports:
- 27119:27017
links:
- shard01-a
- shard02-a
- shard03-a
## Config server 02
configsvr02:
build:
context: .
dockerfile: .docker/configserver.dockerfile
container_name: mongo-config-02
volumes:
- ./scripts:/scripts
ports:
- 27120:27017
links:
- configsvr01
## Config server 03
configsvr03:
build:
context: .
dockerfile: .docker/configserver.dockerfile
container_name: mongo-config-03
volumes:
- ./scripts:/scripts
ports:
- 27121:27017
links:
- configsvr02
# Shards
## Shards 01
shard01-a:
image: mongo:5.0.3
container_name: shard-01-node-a
command: |
mongod --port 27017 --shardsvr --replSet rs-shard-01
volumes:
- ./scripts:/scripts
ports:
- 27122:27017
links:
- shard01-b
- shard01-c
shard01-b:
image: mongo:5.0.3
container_name: shard-01-node-b
command: |
mongod --port 27017 --shardsvr --replSet rs-shard-01
volumes:
- ./scripts:/scripts
ports:
- 27123:27017
shard01-c:
image: mongo:5.0.3
container_name: shard-01-node-c
command: |
mongod --port 27017 --shardsvr --replSet rs-shard-01
volumes:
- ./scripts:/scripts
ports:
- 27124:27017
## Shards 02
shard02-a:
image: mongo:5.0.3
container_name: shard-02-node-a
command: |
mongod --port 27017 --shardsvr --replSet rs-shard-02
volumes:
- ./scripts:/scripts
ports:
- 27125:27017
links:
- shard02-b
- shard02-c
shard02-b:
image: mongo:5.0.3
container_name: shard-02-node-b
command: |
mongod --port 27017 --shardsvr --replSet rs-shard-02
volumes:
- ./scripts:/scripts
ports:
- 27126:27017
shard02-c:
image: mongo:5.0.3
container_name: shard-02-node-c
command: |
mongod --port 27017 --shardsvr --replSet rs-shard-02
volumes:
- ./scripts:/scripts
ports:
- 27127:27017
## Shards 03
shard03-a:
image: mongo:5.0.3
container_name: shard-03-node-a
command: |
mongod --port 27017 --shardsvr --replSet rs-shard-03
volumes:
- ./scripts:/scripts
ports:
- 27128:27017
links:
- shard03-b
- shard03-c
shard03-b:
image: mongo:5.0.3
container_name: shard-03-node-b
command: |
mongod --port 27017 --shardsvr --replSet rs-shard-03
volumes:
- ./scripts:/scripts
ports:
- 27129:27017
shard03-c:
image: mongo:5.0.3
container_name: shard-03-node-c
command: |
mongod --port 27017 --shardsvr --replSet rs-shard-03
volumes:
- ./scripts:/scripts
ports:
- 27130:27017