cloud-computing/glusterfs/setup.sh

28 lines
889 B
Bash
Raw Normal View History

2023-06-16 13:10:10 +02:00
#!/bin/bash
BASE_URL=https://git.cringe-studios.com/CringeStudios/cloud-computing/raw/branch/main/glusterfs
HOSTNAME=team07-glusterfs-0
apt update
apt install -y docker docker-compose
hostnamectl set-hostname $HOSTNAME
systemctl enable --now docker
cd /home/ubuntu
wget -O docker-compose.yml $BASE_URL/docker-compose.yml
2023-06-17 13:03:03 +02:00
wget -O my.layout $BASE_URL/my.layout
2023-06-17 13:30:57 +02:00
sfdisk /dev/xvdb < my.layout
2023-06-17 13:40:45 +02:00
sleep 10
2023-06-17 13:19:23 +02:00
mkfs.ext4 /dev/xvdb1
echo "/dev/xvdb1 /data ext4 defaults 0 0" >> /etc/fstab
mkdir -p /data && mount -a && mkdir -p /data/gv0
2023-06-17 13:51:12 +02:00
docker-compose up -d
2023-06-17 14:00:52 +02:00
#sleep 5
2023-06-17 14:10:26 +02:00
#docker-compose exec -T glusterfs gluster peer probe 10.0.1.61
#docker-compose exec -T glusterfs gluster peer probe 10.0.1.62
#docker-compose exec -T glusterfs gluster volume create gv0 disperse 3 redundancy 1 10.0.1.60:/data/gv0 10.0.1.61:/data/gv0 10.0.1.62:/data/gv0
#docker-compose exec -T glusterfs gluster volume start gv0