-
Notifications
You must be signed in to change notification settings - Fork 0
/
mongo-replica-set.yaml
40 lines (35 loc) · 1.08 KB
/
mongo-replica-set.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
version: '3.8'
services:
mongoreplica01:
image: mongo:latest
container_name: mongo-replica-01
ports:
- "27017:27017"
command: ["mongod", "--replSet", "mongoReplicaSet","--wiredTigerCacheSizeGB","2", "--bind_ip", "localhost,mongo-replica-01"]
networks:
- mongo-replica-cluster
volumes:
- ./volume/mongoreplica01:/data/db
mongoreplica02:
image: mongo:latest
container_name: mongo-replica-02
ports:
- "27018:27017"
command: ["mongod", "--replSet", "mongoReplicaSet", "--wiredTigerCacheSizeGB", "2", "--bind_ip","localhost,mongo-replica-02"]
networks:
- mongo-replica-cluster
volumes:
- ./volume/mongoreplica02:/data/db
mongoreplica03:
image: mongo:latest
container_name: mongo-replica-03
ports:
- "27019:27017"
command: ["mongod", "--replSet", "mongoReplicaSet","--wiredTigerCacheSizeGB","2", "--bind_ip","localhost,mongo-replica-03"]
networks:
- mongo-replica-cluster
volumes:
- ./volume/mongoreplica03:/data/db
networks:
mongo-replica-cluster:
driver: bridge