Skip to content

Commit b252dd2

Browse files
committed
Data and metadata are now persistent so you can easily start/stop cluster
1 parent 3858cce commit b252dd2

File tree

1 file changed

+61
-39
lines changed

1 file changed

+61
-39
lines changed

docker-compose.yml

Lines changed: 61 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,123 @@
1-
version: '2'
1+
version: '3'
22
services:
33
mfsmaster:
4-
image: moosefs/master #use GitHub version
5-
# build: ./moosefs-master #use local version
4+
build: ./moosefs-master
65
container_name: "mfsmaster"
76
networks:
87
moosefsnet:
98
ipv4_address: "172.20.0.2"
10-
ports:
11-
- "9425:9425"
12-
mfsclient:
13-
image: moosefs/client #use GitHub version
14-
# build: ./moosefs-client #use local version
15-
container_name: "mfsclient"
16-
cap_add:
17-
- SYS_ADMIN
18-
devices:
19-
- /dev/fuse:/dev/fuse
20-
security_opt:
21-
- apparmor:unconfined
22-
stdin_open: true
23-
tty: true
24-
links:
25-
- mfsmaster
9+
volumes:
10+
- ./data/master/meta:/var/lib/mfs
11+
hostname: mfsmaster
12+
environment:
13+
- MFS_ENV=TEST
14+
# In the TEST environment, if metadata.mfs file or other metadata files
15+
# like metdata.mfs.back and changelog.0.mfs are missing, the script will
16+
# create an EMPTY metadata file!
17+
# When MFS_ENV=PROD metdata.mfs file will not be created!
18+
19+
mfscgi:
20+
build: ./moosefs-cgi
21+
container_name: "mfscgi"
2622
networks:
2723
moosefsnet:
28-
ipv4_address: "172.20.0.5"
24+
ipv4_address: "172.20.0.3"
25+
ports:
26+
- "9425:9425"
2927
depends_on:
3028
- mfsmaster
29+
3130
mfschunkserver1:
32-
image: moosefs/chunkserver #use GitHub version
33-
# build: ./moosefs-chunkserver #use local version
31+
build: ./moosefs-chunkserver
3432
container_name: "mfschunkserver1"
3533
environment:
3634
- LABELS=M
37-
- SIZE=10
35+
#- SIZE=100
3836
links:
3937
- mfsmaster
4038
networks:
4139
moosefsnet:
4240
ipv4_address: "172.20.0.11"
4341
volumes:
44-
- ./data/cs1_hdd0:/mnt/hdd0
42+
- ./data/cs1/hdd0:/mnt/hdd0
43+
- ./data/cs1/meta:/var/lib/mfs
4544
depends_on:
4645
- mfsmaster
4746
mfschunkserver2:
48-
image: moosefs/chunkserver #use GitHub version
49-
# build: ./moosefs-chunkserver #use local version
47+
build: ./moosefs-chunkserver
5048
container_name: "mfschunkserver2"
5149
environment:
52-
- LABELS=MB
53-
- SIZE=10
50+
- LABELS=M,B
51+
#- SIZE=100
5452
links:
5553
- mfsmaster
5654
networks:
5755
moosefsnet:
5856
ipv4_address: "172.20.0.12"
5957
volumes:
60-
- ./data/cs2_hdd0:/mnt/hdd0
58+
- ./data/cs2/hdd0:/mnt/hdd0
59+
- ./data/cs2/meta:/var/lib/mfs
6160
depends_on:
6261
- mfsmaster
6362
mfschunkserver3:
64-
image: moosefs/chunkserver #use GitHub version
65-
# build: ./moosefs-chunkserver #use local version
63+
build: ./moosefs-chunkserver
6664
container_name: "mfschunkserver3"
6765
environment:
68-
- LABELS=MB
69-
- SIZE=10
66+
- LABELS=M,B
67+
#- SIZE=100
7068
links:
7169
- mfsmaster
7270
networks:
7371
moosefsnet:
7472
ipv4_address: "172.20.0.13"
7573
volumes:
76-
- ./data/cs3_hdd0:/mnt/hdd0
74+
- ./data/cs3/hdd0:/mnt/hdd0
75+
- ./data/cs3/meta:/var/lib/mfs
7776
depends_on:
7877
- mfsmaster
7978
mfschunkserver4:
80-
image: moosefs/chunkserver #use GitHub version
81-
# build: ./moosefs-chunkserver #use local version
79+
build: ./moosefs-chunkserver
8280
container_name: "mfschunkserver4"
8381
environment:
8482
- LABELS=B
85-
- SIZE=10
83+
#- SIZE=100
8684
links:
8785
- mfsmaster
8886
networks:
8987
moosefsnet:
9088
ipv4_address: "172.20.0.14"
9189
volumes:
92-
- ./data/cs4_hdd0:/mnt/hdd0
90+
- ./data/cs4/hdd0:/mnt/hdd0
91+
- ./data/cs4/meta:/var/lib/mfs
92+
depends_on:
93+
- mfsmaster
94+
95+
mfsclient:
96+
build: ./moosefs-client
97+
container_name: "mfsclient"
98+
cap_add:
99+
- SYS_ADMIN
100+
devices:
101+
- /dev/fuse:/dev/fuse
102+
security_opt:
103+
- apparmor:unconfined
104+
stdin_open: true
105+
tty: true
106+
links:
107+
- mfsmaster
108+
networks:
109+
moosefsnet:
110+
ipv4_address: "172.20.0.100"
93111
depends_on:
94112
- mfsmaster
113+
- mfschunkserver1
114+
- mfschunkserver2
115+
- mfschunkserver3
116+
- mfschunkserver4
117+
95118
networks:
96119
moosefsnet:
97120
driver: bridge
98121
ipam:
99122
config:
100123
- subnet: 172.20.0.0/16
101-
gateway: 172.20.0.1

0 commit comments

Comments
 (0)