Redundant Storage Pool Using GlusterFS on Debian Servers for moodle
Launch three ubuntu based EC2/VM (EIP recommended for production) & security groups with ports open as shown below.
Security Group For GFS
Type | Protocol | Ports | Source | Description |
---|---|---|---|---|
SSH | SSH | 22 | Administration Host Security Group | Administration Host Security Group |
Custom TCP Rule | TCP | 24007 | Gluster Server | Gluster Daemon |
Custom TCP Rule | TCP | 111 | Gluster Server | Portmapper |
Custom UCP Rule | UDP | 111 | Gluster Server | Portmapper |
Custom TCP Rule | TCP | 49152-49155 | Gluster Server | Each brick for every volume on your host requires its own port |
Custom TCP Rule | TCP | 2049 | Gluster Server | NFS |
Security Group For Moodle (LAMP)
Type | Protocol | Ports | Source | Description |
---|---|---|---|---|
HTTP | TCP | 80 | Users | For HTTP traffic |
HTTPS | TCP | 443 | Users | For HTTPS traffic |
Custom ICMP IPv4 | All | All | 0.0.0.0/0 | For ICMP traffic |
Security Group For Database
Type | Protocol | Ports |
---|---|---|
RDS | TCP | 3306 |
Here is AWS CLI script if you want to launch through CLI or use AWS Console
aws ec2 run-instances \
--image-id ami-xxxxxxxxxxxxxx\
--count 3 \
--instance-type xx.xxxx \
--key-name YourKey \
--security-group-ids sg-xxxxxxxxxxxx \
--subnet-id subnet-xxxxxxx \
--associate-public-ip-address \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=GlusterFS -}]'
Use Putty to SSH into all three Servers, Configure putty If you want to use muti-SSH try mRemoteNG Also Note down the Public IP for all three servers, for the easy of understanding
Let's Re-name Servers on Console
Server | Rename to | Public IP |
---|---|---|
Server 1 | GlusterFS-01 | ip1 (use your server1 public IP) |
Server 2 | GlusterFS-02 | ip2 (use your server2 public IP) |
Server 3 | GlusterFS-03 | ip3 (use your server3 public IP) |
Make sure EC2/VM have git installed
To check
git --version
To install git
sudo apt install git-all
Read on dev.to
Read on iCTPro.co.nz
Read on dev.to
Read on iCTPro.co.nz
SSH into Servers orderly and run commands
Get root privilages to run command
sudo su -
Stage | On Server | Command |
---|---|---|
1 | GlusterFS-03 | wget https://raw.githubusercontent.com/anuvindhs/GFS-Moo/main/install.sh chmod u+x install.sh ./install.sh |
2 | GlusterFS-02 | wget https://raw.githubusercontent.com/anuvindhs/GFS-Moo/main/install.sh chmod u+x install.sh ./install.sh |
3 | GlusterFS-01 | wget https://raw.githubusercontent.com/anuvindhs/GFS-Moo/main/install.sh chmod u+x install.sh ./install.sh |
sudo mount -t glusterfs gfs-moo-01:/gv0 /var/www/moodledata
Released under the MIT license.