-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
107 lines (103 loc) · 2.93 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
version: '2'
services:
## Config Servers
config01:
image: mongo:4.4.1
command: mongod --auth --port 27017 --configsvr --replSet configserver --dbpath /data/db --oplogSize 16 --keyFile /mongodb.key
volumes:
- ./mongodb.key:/mongodb.key
- ./scripts:/scripts
networks:
- all
config02:
image: mongo:4.4.1
command: mongod --auth --port 27017 --configsvr --replSet configserver --dbpath /data/db --oplogSize 16 --keyFile /mongodb.key
volumes:
- ./mongodb.key:/mongodb.key
- ./scripts:/scripts
networks:
- all
config03:
image: mongo:4.4.1
command: mongod --auth --port 27017 --configsvr --replSet configserver --dbpath /data/db --oplogSize 16 --keyFile /mongodb.key
volumes:
- ./mongodb.key:/mongodb.key
- ./scripts:/scripts
networks:
- all
## Shards
shard01a:
image: mongo:4.4.1
command: mongod --auth --port 27018 --shardsvr --replSet shard01 --dbpath /data/db --oplogSize 16 --keyFile /mongodb.key
volumes:
- ./mongodb.key:/mongodb.key
- ./scripts:/scripts
networks:
- all
shard01b:
image: mongo:4.4.1
command: mongod --auth --port 27018 --shardsvr --replSet shard01 --dbpath /data/db --oplogSize 16 --keyFile /mongodb.key
volumes:
- ./mongodb.key:/mongodb.key
- ./scripts:/scripts
networks:
- all
shard02a:
image: mongo:4.4.1
command: mongod --auth --port 27019 --shardsvr --replSet shard02 --dbpath /data/db --oplogSize 16 --keyFile /mongodb.key
volumes:
- ./mongodb.key:/mongodb.key
- ./scripts:/scripts
networks:
- all
shard02b:
image: mongo:4.4.1
command: mongod --auth --port 27019 --shardsvr --replSet shard02 --dbpath /data/db --oplogSize 16 --keyFile /mongodb.key
volumes:
- ./mongodb.key:/mongodb.key
- ./scripts:/scripts
networks:
- all
shard03a:
image: mongo:4.4.1
command: mongod --auth --port 27020 --shardsvr --replSet shard03 --dbpath /data/db --oplogSize 16 --keyFile /mongodb.key
volumes:
- ./mongodb.key:/mongodb.key
- ./scripts:/scripts
networks:
- all
shard03b:
image: mongo:4.4.1
command: mongod --auth --port 27020 --shardsvr --replSet shard03 --dbpath /data/db --oplogSize 16 --keyFile /mongodb.key
volumes:
- ./mongodb.key:/mongodb.key
- ./scripts:/scripts
networks:
- all
## Router
router:
image: mongo:4.4.1
command: mongos --port 8081 --configdb configserver/config01:27017,config02:27017,config03:27017 --bind_ip_all --keyFile /mongodb.key
ports:
- "8081:8081"
volumes:
- ./mongodb.key:/mongodb.key
- ./scripts:/scripts
depends_on:
- config01
- config02
- config03
- shard01a
- shard01b
- shard02a
- shard02b
- shard03a
- shard03b
networks:
- all
networks:
all:
ipam:
driver: default
config:
- subnet: 10.1.0.0/16