From 42e30ce614196dad0c29656d682331602394875c Mon Sep 17 00:00:00 2001 From: Sara Stentvedt Luggenes <saraslu@stud.ntnu.no> Date: Mon, 27 Mar 2023 01:28:33 +0200 Subject: [PATCH] halvparten av week 10 --- oblig3/oblig3.md | 59 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 3 deletions(-) diff --git a/oblig3/oblig3.md b/oblig3/oblig3.md index 011246a..13ae760 100644 --- a/oblig3/oblig3.md +++ b/oblig3/oblig3.md @@ -1,6 +1,59 @@ -## Week 10 - Gluster File Storage +# Week 10 - Gluster File Storage +## Gluster installation +### Task 1 +We start by installing Gluster on all three severs: +``` +apt-get -y install glusterfs-server glusterfs-client +systemctl enable glusterd +systemctl start glusterd +``` + +### Task 2 +Then we make the bricks(byggeklosser). These bricks is just folders for the distributed storage, and in the real world it should have been real harddrives. We use ordinary folders since we use VMs, and dont want to use a lot on resources on volumes. We make a folder where the images in bookface is stored, and another folder for configuration(we do this on all three servers): +``` +mkdir /bf_brick +mkdir /config_brick +``` +Then we make two folders, which will be the place we "mounts" the distributed filesystems. These are the folders we are gonna use(we do this on all three servers): +``` +mkdir /bf_images +mkdir /bf_config +``` + +### Task 3 +Then we have to add two of the servers to the cluster, we do this commands on server 1: +``` +gluster peer probe 192.168.134.194 +gluster peer probe 192.168.130.56 +``` +The ip-addresses above is for server 2 and server 3. + +We make sure the commands above are successfull by using the command ```gluster peer status``` on server 1. This will give the following output, which verifies that both server 2 and server 3 is added to the cluster: +``` +# OUTPUT +Number of Peers: 2 + +Hostname: 192.168.134.194 +Uuid: beba9453-41df-44c9-9581-d9253bf3eef2 +State: Peer in Cluster (Connected) + +Hostname: 192.168.130.56 +Uuid: 4fef7622-32ad-4ea1-bde3-2bab6e71ac6f +State: Peer in Cluster (Connected) +``` + +### Task 4 +Now we create the two volumes to be distributed. We call one volume "bf_images" and the other one "bf_config". The following commands have to be done at only one server, we do it on server 1: +``` +gluster volume create bf_images replica 3 192.168.134.127:/bf_brick 192.168.134.194:/bf_brick 192.168.130.56:/bf_brick force +gluster volume start bf_images +gluster volume create bf_config replica 3 192.168.134.127:/config_brick 192.168.134.194:/config_brick 192.168.130.56:/config_brick force +gluster volume start bf_config +``` +The ip-addresses above is for server 1, server 2 and server 3. The data in bf_images and bf_config is gonna be replicated 3 times, one for each server. This is not space efficient, but in environments where high-availability and high-reliability are critical, it is the most optimal solution. + +### Task 5 -### Gluster installation ### Scripts and automation @@ -34,7 +87,7 @@ FLOATING_IP_ID: 5337587f-47b4-4d98-922e-981ed2231c28 ``` -# Week 12 +# Week 12 - Capacity calculation through statistical distributions ## Task 1 ### 50k.dat -- GitLab