forked from openimsdk/open-im-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-shard-cluster.yaml
113 lines (110 loc) · 2.71 KB
/
docker-compose-shard-cluster.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
version: '3'
networks:
mongo-network:
external: false
services:
# 配置服务器configsvr
config:
image: mongo:latest
networks:
- mongo-network
container_name: config
restart: always
ports:
- 27019:27019
command: --configsvr --replSet "config" --bind_ip_all
volumes:
- ./components/config_mongodb/data/db:/data/db
- ./components/config_mongodb/data/logs:/data/logs
- ./components/config_mongodb/data/conf:/etc/mongo
- ./components/config_mongodb/data/configdb:/data/configdb
environment:
- TZ=Asia/Shanghai
# cache
- wiredTigerCacheSizeGB=1
# shard分片1
shard1:
image: mongo:latest
networks:
- mongo-network
container_name: shard1
restart: always
ports:
- 27118:27018
command: --shardsvr --replSet "shard1" --bind_ip_all
volumes:
- /data01/mongo/shard1/db:/data/db
- /data01/mongo/shard1/configdb:/data/configdb
environment:
- TZ=Asia/Shanghai
# cache
- wiredTigerCacheSizeGB=1
# shard分片2
shard2:
image: mongo:latest
networks:
- mongo-network
container_name: shard2
restart: always
ports:
- 27218:27018
command: --shardsvr --replSet "shard2" --bind_ip_all
volumes:
- /data02/mongo/shard2/db:/data/db
- /data02/mongo/shard2/configdb:/data/configdb
environment:
- TZ=Asia/Shanghai
# cache
- wiredTigerCacheSizeGB=1
# - ${PWD}/key.file:/data/mongodb/key.file
# shard分片3
shard3:
image: mongo:latest
networks:
- mongo-network
container_name: shard3
restart: always
ports:
- 27318:27018
command: --shardsvr --replSet "shard3" --bind_ip_all
volumes:
- /data03/mongo/shard3/db:/data/db
- /data03/mongo/shard3/configdb:/data/configdb
environment:
- TZ=Asia/Shanghai
# cache
- wiredTigerCacheSizeGB=1
# shard分片4
shard4:
image: mongo:latest
networks:
- mongo-network
container_name: shard4
restart: always
ports:
- 27418:27018
command: --shardsvr --replSet "shard4" --bind_ip_all
volumes:
- /data04/mongo/shard4/db:/data/db
- /data04/mongo/shard4/configdb:/data/configdb
environment:
- TZ=Asia/Shanghai
# cache
- wiredTigerCacheSizeGB=1
# shard分片5
shard5:
image: mongo:latest
networks:
- mongo-network
container_name: shard5
restart: always
ports:
- 27518:27018
command: --shardsvr --replSet "shard5" --bind_ip_all
volumes:
- /data05/mongo/shard5/db:/data/db
- /data05/mongo/shard5/configdb:/data/configdb
environment:
- TZ=Asia/Shanghai
# cache
- wiredTigerCacheSizeGB=1