-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
72 lines (72 loc) · 1.7 KB
/
docker-compose.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
version: '2'
services:
## 1 Config Servers
config-0:
container_name: config-0
image: mongo:latest
command: mongod --port 27017 --configsvr --replSet configserver
volumes:
- ./scripts:/scripts
networks:
- sharded_mongo
config-1:
container_name: config-1
image: mongo:latest
command: mongod --port 27017 --configsvr --replSet configserver
volumes:
- ./scripts:/scripts
networks:
- sharded_mongo
## 2 Shards, 2 replica for each shards
shard0-0:
image: mongo:latest
container_name: shard0-0
command: mongod --port 27017 --shardsvr --replSet shard0
volumes:
- ./scripts:/scripts
networks:
- sharded_mongo
shard0-1:
image: mongo:latest
container_name: shard0-1
command: mongod --port 27017 --shardsvr --replSet shard0
volumes:
- ./scripts:/scripts
networks:
- sharded_mongo
shard1-0:
image: mongo:latest
container_name: shard1-0
command: mongod --port 27017 --shardsvr --replSet shard1
volumes:
- ./scripts:/scripts
networks:
- sharded_mongo
shard1-1:
image: mongo:latest
container_name: shard1-1
command: mongod --port 27017 --shardsvr --replSet shard1
volumes:
- ./scripts:/scripts
networks:
- sharded_mongo
## Router
router:
image: mongo:latest
container_name: mongo
command: mongos --port 27017 --configdb configserver/config-0:27017,config-1:27017 --bind_ip_all
ports:
- "27017:27017"
volumes:
- ./scripts:/scripts
depends_on:
- config-0
- config-1
- shard0-0
- shard0-1
- shard1-0
- shard1-1
networks:
- sharded_mongo
networks:
sharded_mongo: