-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.shard.yml
56 lines (52 loc) · 1.28 KB
/
docker-compose.shard.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
version: '3'
services:
# Shard
shard-01-a:
build:
context: mongodb
image: mongodb:latest
container_name: shard-01-a
command: mongod --port 27017 --shardsvr --replSet rs-shard-01 --bind_ip_all --keyFile /data/mongodb-keyfile
volumes:
- ./scripts:/scripts
- shard_a_db:/data/db
- shard_a_config:/data/configdb
ports:
- 27301:27017
restart: always
links:
- shard-01-b
- shard-01-c
shard-01-b:
build:
context: mongodb
image: mongodb:latest
container_name: shard-01-b
command: mongod --port 27017 --shardsvr --replSet rs-shard-01 --bind_ip_all --keyFile /data/mongodb-keyfile
volumes:
- ./scripts:/scripts
- shard_b_db:/data/db
- shard_b_config:/data/configdb
ports:
- 27302:27017
restart: always
shard-01-c:
build:
context: mongodb
image: mongodb:latest
container_name: shard-01-c
command: mongod --port 27017 --shardsvr --replSet rs-shard-01 --bind_ip_all --keyFile /data/mongodb-keyfile
volumes:
- ./scripts:/scripts
- shard_c_db:/data/db
- shard_c_config:/data/configdb
ports:
- 27303:27017
restart: always
volumes:
shard_a_db:
shard_a_config:
shard_b_db:
shard_b_config:
shard_c_db:
shard_c_config: