first commit

This commit is contained in:
2024-09-11 12:07:01 +03:00
parent fd244cd2f1
commit 3eabe63e90
4 changed files with 156 additions and 0 deletions

34
testing/Dockerfile Normal file
View File

@@ -0,0 +1,34 @@
FROM ubuntu:noble
ENV DEBIAN_FRONTEND=noninteractive
RUN \
apt update && \
apt install -y --no-install-recommends apt-utils && \
apt install -y --no-install-recommends tzdata \
ca-certificates \
build-essential \
tini && \
apt install -y --no-install-recommends \
dnsutils \
net-tools \
nano \
glusterfs-server \
glusterfs-client \
glusterfs-cli \
glusterfs-common \
fuse3 \
libfuse3-3 \
attr \
xattr && \
apt autoremove --purge -y && \
apt clean -y && \
rm -rf /tmp/*
ADD glusterfs-master.sh /docker/glusterfs-master.sh
ADD glusterfs-node.sh /docker/glusterfs-node.sh
EXPOSE 111 111/udp 24007 24009 49152
ENV TZ=Europe/Moscow
STOPSIGNAL SIGINT
ENTRYPOINT ["tini", "--"]

View File

@@ -0,0 +1,89 @@
---
networks:
testing:
name: testing
volumes:
gluster-data-1:
name: gluster-1
gluster-data-2:
name: gluster-2
gluster-data-3:
name: gluster-3
services:
gluster-1:
build:
context: .
dockerfile: Dockerfile
image: registry.ghostklart.com/ubuntu/testing:latest
container_name: gluster-1
hostname: gluster-1
user: root:root
cap_add:
- SYS_ADMIN
- MKNOD
logging:
options:
max-size: 10m
devices:
- /dev/fuse
volumes:
- gluster-data-1:/mnt/gluster
networks:
- testing
command: bash /docker/glusterfs-master.sh
privileged: true
gluster-2:
build:
context: .
dockerfile: Dockerfile
image: registry.ghostklart.com/ubuntu/testing:latest
container_name: gluster-2
hostname: gluster-2
user: root:root
cap_add:
- SYS_ADMIN
- MKNOD
logging:
options:
max-size: 10m
depends_on:
- gluster-1
devices:
- /dev/fuse
volumes:
- gluster-data-2:/mnt/gluster
networks:
- testing
command: bash /docker/glusterfs-node.sh
privileged: true
gluster-3:
build:
context: .
dockerfile: Dockerfile
image: registry.ghostklart.com/ubuntu/testing:latest
container_name: gluster-3
hostname: gluster-3
user: root:root
cap_add:
- SYS_ADMIN
- MKNOD
logging:
options:
max-size: 10m
depends_on:
- gluster-1
devices:
- /dev/fuse
volumes:
- gluster-data-3:/mnt/gluster
networks:
- testing
command: bash /docker/glusterfs-node.sh
privileged: true

View File

@@ -0,0 +1,21 @@
#!/bin/bash
# # # special thing to start and set up the glusterfs 4 damir
# # # bootstrap fuse
#mknod /dev/fuse c 10 229
# start gluster fs daemon
/usr/sbin/glusterd -L DEBUG --volfile-server-port=49153
# add folder
mkdir -p /mnt/gluster/gv0
mkdir -p /mnt/glusterfs
# add mount
echo "localhost:/gv0 /mnt/glusterfs glusterfs defaults,_netdev 0 0" > /etc/fstab
sleep 1
gluster peer probe gluster-2
sleep 1
gluster peer probe gluster-3
sleep 5
gluster volume create gv0 replica 3 transport tcp gluster-1:/mnt/gluster/gv0 gluster-2:/mnt/gluster/gv0 gluster-3:/mnt/gluster/gv0 force
gluster volume start gv0 force
mount /mnt/glusterfs
echo "Done, test..."
sleep infinity

12
testing/glusterfs-node.sh Normal file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
# # # bootstrap fuse
#mknod /dev/fuse c 10 229
# # # worker nodes
/usr/sbin/glusterd -L DEBUG --volfile-server-port=49153
mkdir -p /mnt/gluster/gv0
mkdir -p /mnt/glusterfs
echo "localhost:/gv0 /mnt/glusterfs glusterfs defaults,_netdev 0 0" > /etc/fstab
sleep 15
mount /mnt/glusterfs
echo "Done, test"
sleep infinity