-
-
Notifications
You must be signed in to change notification settings - Fork 212
/
Copy pathdocker-compose.yml
163 lines (150 loc) · 4.78 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
services:
## Router
router01:
image: mongo:latest
container_name: router-01
ports:
- "27117:27017"
restart: always
volumes:
- ./scripts:/scripts
- mongodb_cluster_router01_db:/data/db
- mongodb_cluster_router01_config:/data/configdb
entrypoint: ["/scripts/entrypoint-route.sh"]
## Config Servers
configsvr01:
image: mongo:latest
container_name: mongo-config-01
volumes:
- ./scripts:/scripts
- mongodb_cluster_configsvr01_db:/data/db
- mongodb_cluster_configsvr01_config:/data/configdb
restart: always
entrypoint: ["/scripts/entrypoint-configserver.sh"]
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
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
## Shards
shard01-a:
image: mongo:latest
container_name: shard-01-node-a
volumes:
- ./scripts:/scripts
- mongodb_cluster_shard01_a_db:/data/db
- mongodb_cluster_shard01_a_config:/data/configdb
restart: always
entrypoint: ["/bin/sh", "/scripts/entrypoint-shard01.sh"]
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
shard02-a:
image: mongo:latest
container_name: shard-02-node-a
volumes:
- ./scripts:/scripts
- mongodb_cluster_shard02_a_db:/data/db
- mongodb_cluster_shard02_a_config:/data/configdb
restart: always
entrypoint: ["/bin/sh", "/scripts/entrypoint-shard02.sh"]
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
shard03-a:
image: mongo:latest
container_name: shard-03-node-a
volumes:
- ./scripts:/scripts
- mongodb_cluster_shard03_a_db:/data/db
- mongodb_cluster_shard03_a_config:/data/configdb
restart: always
entrypoint: ["/bin/sh", "/scripts/entrypoint-shard03.sh"]
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_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: