Skip to content

Commit d0f1122

Browse files
committed
Update to MooseFS 4.57.6
The use of the MooseFS repository in containers has been discontinued
1 parent fdab221 commit d0f1122

File tree

15 files changed

+191
-94
lines changed

15 files changed

+191
-94
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
data
2+
.DS_Store

README.md

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ This is a basic configuration of a multiple-node MooseFS cluster based on the De
44

55
# Updates
66

7+
- Update cluster to version 4.57.6
8+
- The use of the MooseFS repository in containers has been discontinued. Binary files are compiled from source. This approach will make it easier to run the cluster on different CPU architectures.
79
- All MooseFS processes are now correctly handling signals.
810
- Metadata and data are now persistent and mounted as volumes.
911
- TEST and PROD moosefs master metadata behavior defined by `MFS_ENV` variable.
@@ -23,13 +25,14 @@ This is a basic configuration of a multiple-node MooseFS cluster based on the De
2325
- Chunkserver 2: `172.20.0.12`, labels: `M, B`
2426
- Chunkserver 3: `172.20.0.13`, labels: `M, B`
2527
- Chunkserver 4: `172.20.0.14`, labels: `B`
26-
- Client: `172.168.20.0.100`
28+
- Client1: `172.168.20.0.101`
29+
- Client2: `172.168.20.0.102`
2730

2831
# Setup
2932

30-
Install Docker with Docker Composer from [https://docs.docker.com/compose/install](https://docs.docker.com/compose/install)
33+
> Docker Compose is required!
3134
32-
Clone MooseFS docker config files:
35+
Clone MooseFS docker cluster repository:
3336

3437
```
3538
git clone https://github.com/moosefs/moosefs-docker-cluster
@@ -39,22 +42,14 @@ cd moosefs-docker-cluster
3942
Build and run:
4043

4144
```
42-
docker-compose build
43-
docker-compose up
45+
docker compose build
46+
docker compose up
4447
```
4548

46-
On Linux OS run `docker-compose` as root:
49+
You can also run `docker compose` in detached mode. All running Docker nodes will run in the background, so Docker console output will be invisible.
4750

4851
```
49-
sudo -E docker-compose build
50-
sudo -E docker-compose up
51-
```
52-
53-
You can also run `docker-compose` in detached mode. All running Docker nodes will run in the background, so Docker console output will be invisible.
54-
55-
```
56-
sudo -E docker-compose build
57-
sudo -E docker-compose up -d
52+
docker compose up -d
5853
```
5954

6055
You can check if instances are running:
@@ -63,26 +58,27 @@ You can check if instances are running:
6358
docker ps
6459
```
6560

66-
You should have 1 Master Server, 1 Metalogger, 4 Chunkservers and 1 Client running (first configuration). The expected output should be similar to the following:
61+
You should have 1 Master Server, 1 Metalogger, 4 Chunkservers and 2 Clients running. The expected output should be similar to the following:
6762

6863
```
69-
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
70-
abf5910b53bc moosefsdockercluster_mfsclient "mfsmount -f /mnt/mo…" 7 minutes ago Up 7 minutes mfsclient
71-
7a1152cc31f3 moosefsdockercluster_mfschunkserver3 "chunkserver.sh" 7 minutes ago Up 7 minutes 9422/tcp mfschunkserver3
72-
b8c2cd770187 moosefsdockercluster_mfschunkserver2 "chunkserver.sh" 7 minutes ago Up 7 minutes 9422/tcp mfschunkserver2
73-
100f20683b3a moosefsdockercluster_mfschunkserver1 "chunkserver.sh" 7 minutes ago Up 7 minutes 9422/tcp mfschunkserver1
74-
68ffb70ab361 moosefsdockercluster_mfschunkserver4 "chunkserver.sh" 7 minutes ago Up 7 minutes 9422/tcp mfschunkserver4
75-
82a2c3bd831d moosefsdockercluster_mfsmetalogger "metalogger.sh" 7 minutes ago Up 7 minutes mfsmetalogger
76-
05736e4bdd3c moosefsdockercluster_mfscgi "mfscgiserv -f" 7 minutes ago Up 7 minutes 0.0.0.0:9425->9425/tcp mfscgi
77-
e83a1fb062a1 moosefsdockercluster_mfsmaster "master.sh" 7 minutes ago Up 7 minutes 9419-9421/tcp mfsmaster
64+
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
65+
f104d5b2f737 moosefs-docker-cluster-mfsclient2 "mount.sh" 3 minutes ago Up 3 seconds mfsclient2
66+
74de405a4baa moosefs-docker-cluster-mfsclient1 "mount.sh" 3 minutes ago Up 3 seconds mfsclient1
67+
4d8637367bbd moosefs-docker-cluster-mfschunkserver3 "chunkserver.sh" 3 minutes ago Up 3 seconds 9422/tcp mfschunkserver3
68+
8bbe27c0a913 moosefs-docker-cluster-mfschunkserver4 "chunkserver.sh" 3 minutes ago Up 3 seconds 9422/tcp mfschunkserver4
69+
bdceb9669fae moosefs-docker-cluster-mfschunkserver2 "chunkserver.sh" 3 minutes ago Up 3 seconds 9422/tcp mfschunkserver2
70+
15de9aef85ec moosefs-docker-cluster-mfschunkserver1 "chunkserver.sh" 3 minutes ago Up 3 seconds 9422/tcp mfschunkserver1
71+
11465da54cb9 moosefs-docker-cluster-mfsmetalogger "metalogger.sh" 3 minutes ago Up 3 seconds mfsmetalogger
72+
3f7c572225c4 moosefs-docker-cluster-mfscgi "cgiserver.sh" 3 minutes ago Up 3 seconds 0.0.0.0:9425->9425/tcp mfscgi
73+
afd43c5c460f moosefs-docker-cluster-mfsmaster "master.sh" 3 minutes ago Up 4 seconds 0.0.0.0:9419-9421->9419-9421/tcp mfsmaster
7874
```
7975

8076
# Attach / detach to / from container
8177

8278
For example, if you like to **attach** to the client node execute this command:
8379

8480
```
85-
docker exec -it mfsclient bash
81+
docker exec -it mfsclient1 bash
8682
```
8783

8884
To **detach** from container, just press `Ctrl + D` keys combination.
@@ -110,7 +106,13 @@ The MooseFS CGI Monitoring Interface is available here: [http://localhost:9425](
110106

111107
Also on Linux, CGI Server container is available at the IP address: [http://172.20.0.3:9425](http://172.20.0.3:9425) (be aware of a local `172.20.0.x` network).
112108

113-
![MooseFS CGI](https://github.com/moosefs/moosefs-docker-cluster/raw/master/images/cgi.png)
109+
![MooseFS GUI status - dark](https://github.com/moosefs/moosefs-docker-cluster/raw/master/images/gui1.png)
110+
111+
![MooseFS GUI status - light](https://github.com/moosefs/moosefs-docker-cluster/raw/master/images/gui2.png)
112+
113+
![MooseFS GUI resources - dark](https://github.com/moosefs/moosefs-docker-cluster/raw/master/images/gui3.png)
114+
115+
![MooseFS GUI resources - light](https://github.com/moosefs/moosefs-docker-cluster/raw/master/images/gui4.png)
114116

115117
# Persistence
116118

docker-compose.yml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
version: '3'
21
services:
32
mfsmaster:
43
build: ./moosefs-master
54
container_name: "mfsmaster"
65
networks:
76
moosefsnet:
87
ipv4_address: "172.20.0.2"
8+
ports:
9+
- "9419:9419"
10+
- "9420:9420"
11+
- "9421:9421"
912
volumes:
1013
- ./data/master/meta:/var/lib/mfs
1114
hostname: mfsmaster
@@ -109,9 +112,31 @@ services:
109112
depends_on:
110113
- mfsmaster
111114

112-
mfsclient:
115+
mfsclient1:
116+
build: ./moosefs-client
117+
container_name: "mfsclient1"
118+
cap_add:
119+
- SYS_ADMIN
120+
devices:
121+
- /dev/fuse:/dev/fuse
122+
security_opt:
123+
- apparmor:unconfined
124+
stdin_open: true
125+
tty: true
126+
links:
127+
- mfsmaster
128+
networks:
129+
moosefsnet:
130+
ipv4_address: "172.20.0.101"
131+
depends_on:
132+
- mfsmaster
133+
- mfschunkserver1
134+
- mfschunkserver2
135+
- mfschunkserver3
136+
- mfschunkserver4
137+
mfsclient2:
113138
build: ./moosefs-client
114-
container_name: "mfsclient"
139+
container_name: "mfsclient2"
115140
cap_add:
116141
- SYS_ADMIN
117142
devices:
@@ -124,7 +149,7 @@ services:
124149
- mfsmaster
125150
networks:
126151
moosefsnet:
127-
ipv4_address: "172.20.0.100"
152+
ipv4_address: "172.20.0.102"
128153
depends_on:
129154
- mfsmaster
130155
- mfschunkserver1

images/cgi.png

-58.3 KB
Binary file not shown.

images/gui1.png

352 KB
Loading

images/gui2.png

315 KB
Loading

images/gui3.png

561 KB
Loading

images/gui4.png

487 KB
Loading

moosefs-cgi/Dockerfile

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
1-
FROM debian:buster
1+
ARG MFS_TAG="v4.57.6"
22

3-
# Install wget and gnupg2
4-
RUN apt-get update && apt-get install -y wget gnupg2 python3
3+
# Build MooseFS chunkserver from source on Debian 12 Bookworm container
4+
# mfsbuilder image is based on Debian 12
5+
FROM ghcr.io/moosefs/mfsbuilder:latest AS mfsbuilder
6+
WORKDIR /moosefs
7+
ARG MFS_TAG
8+
RUN git clone --depth 1 --branch ${MFS_TAG} https://github.com/moosefs/moosefs.git /moosefs
9+
RUN autoreconf -f -i
10+
RUN ./configure --prefix=/usr --mandir=/share/man --sysconfdir=/etc --localstatedir=/var/lib --with-default-user=mfs --with-default-group=mfs --disable-mfsbdev --disable-mfsmount --disable-mfsmaster --disable-mfsmetalogger --disable-mfsnetdump --disable-mfschunkserver
11+
RUN make DESTDIR=/tmp/mfs install
512

6-
# Add key
7-
RUN wget -O - http://ppa.moosefs.com/moosefs.key 2>/dev/null | apt-key add - 2>/dev/null
8-
RUN echo "deb http://ppa.moosefs.com/3.0.117/apt/debian/buster buster main" > /etc/apt/sources.list.d/moosefs.list
13+
#Build moosefs-cgi container
14+
FROM python:3.13-bookworm
15+
COPY --from=mfsbuilder /tmp/mfs/usr /usr
16+
COPY --from=mfsbuilder /tmp/mfs/var /var
917

10-
# Install MooseFS master
11-
RUN apt-get update && apt-get install -y moosefs-cgi moosefs-cgiserv moosefs-cli
12-
13-
# Expose ports master ports
18+
# Expose GUI port
1419
EXPOSE 9425
1520

16-
# Add start script
21+
# Container preparation
1722
ADD cgiserver.sh /usr/sbin/cgiserver.sh
18-
RUN chown root:root /usr/sbin/cgiserver.sh ; chmod 700 /usr/sbin/cgiserver.sh
23+
RUN set -eux; \
24+
useradd -r -d /var/lib/mfs -s /usr/sbin/nologin mfs; \
25+
chown -R mfs:mfs /usr/share/mfscgi; \
26+
chown root:root /usr/sbin/cgiserver.sh; \
27+
chmod 700 /usr/sbin/cgiserver.sh
1928

2029
CMD ["cgiserver.sh"]

moosefs-chunkserver/Dockerfile

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,35 @@
1-
FROM debian:buster
1+
ARG MFS_TAG="v4.57.6"
22

3-
# Install wget, lsb-release and curl
4-
RUN apt-get update && apt-get install -y wget gnupg2 gettext-base
3+
# Build MooseFS chunkserver binaries from source
4+
# MFSbuilder image is based on Debian 12
5+
FROM ghcr.io/moosefs/mfsbuilder:latest AS mfsbuilder
6+
WORKDIR /moosefs
7+
ARG MFS_TAG
8+
RUN git clone --depth 1 --branch ${MFS_TAG} https://github.com/moosefs/moosefs.git /moosefs
9+
RUN set -eux; \
10+
autoreconf -f -i; \
11+
./configure --prefix=/usr --mandir=/share/man --sysconfdir=/etc \
12+
--localstatedir=/var/lib --with-default-user=mfs --with-default-group=mfs \
13+
--disable-mfsbdev --disable-mfsmount --disable-mfsmaster \
14+
--disable-mfsmetalogger --disable-mfsnetdump --disable-mfscgi \
15+
--disable-mfscgiserv --disable-mfscli; \
16+
make DESTDIR=/tmp/mfs install
517

6-
# Add key
7-
RUN wget -O - http://ppa.moosefs.com/moosefs.key 2>/dev/null | apt-key add - 2>/dev/null
8-
RUN echo "deb http://ppa.moosefs.com/3.0.117/apt/debian/buster buster main" > /etc/apt/sources.list.d/moosefs.list
18+
#Build moosefs-chunkserver container
19+
FROM debian:bookworm
20+
COPY --from=mfsbuilder /tmp/mfs/etc /etc
21+
COPY --from=mfsbuilder /tmp/mfs/usr /usr
22+
COPY --from=mfsbuilder /tmp/mfs/var /var
923

10-
# Install MooseFS chunkserver
11-
RUN apt-get update && apt-get install -y moosefs-chunkserver
12-
13-
# Expose ports
24+
# Expose chunkserver port
1425
EXPOSE 9422
1526

16-
# Add start script
27+
# Container preparation
1728
ADD chunkserver.sh /usr/sbin/chunkserver.sh
18-
RUN chown root:root /usr/sbin/chunkserver.sh ; chmod 700 /usr/sbin/chunkserver.sh ; mkdir -p /mnt/hdd0
29+
RUN set -eux; \
30+
useradd -r -d /var/lib/mfs -s /usr/sbin/nologin mfs; \
31+
chown root:root /usr/sbin/chunkserver.sh; \
32+
chmod 700 /usr/sbin/chunkserver.sh; \
33+
mkdir -p /mnt/hdd0
1934

2035
CMD ["chunkserver.sh"]

0 commit comments

Comments
 (0)