DAY 4 - GlusterFS on Cloud
☁️100 days of Cloud- Day Four
✅Follow Me on Twitter
Tweet This Blog - Read on GitHub - read iCTPro.co.nz
What is Gluster File System
GlusterFS (Gluster File System) is an open source Distributed File System that can scale out in building-block fashion to store multiple petabytes of data.
Use Cases
streaming media , content delivery. Scale-out storage systems based on GlusterFS are suitable for unstructured data such as documents, images, audio and video files, and log files.
Prerequisite
- Minimum Three VM,For this demo we deploy it in AWS EC2.
- git on VM's Make sure EC2/VM have git installed To check
git --version
To install git
sudo apt install git-all
- Open ports on Security Groups
Security Group For GFS
Type | Protocol | Ports | Source | Description |
---|---|---|---|---|
SSH | SSH | 22 | Administration Host Security Group | Administration Host Security Group |
Custom TCP Rule | TCP | 2007 | GlusterFS Security Group Secure Transport Server Security Group | Gluster Daemon |
Custom TCP Rule | TCP | 111 | GlusterFS Security Group SecureTransport Server Security Group | Portmapper |
Custom TCP Rule | TCP | 49152-49251 | GlusterFS Security Group SecureTransport Server Security Group | Each brick for every volume on your host requires its own port |
Custom TCP Rule | TCP | 2049 | GlusterFS Security Group SecureTransport Server Security Group | NFS |
Tutorial
In this tutorial
Code Repo - github
- I will launching three ubuntu ec2 instance install.
- Install Gluster FS.
- Peer Servers.
- Create Gluster Volume.
- Test the replication.
If you dont know how to launch ec2 , use this link
Step 1
- launching ec2 , am using Ubuntu Server 20.04 LTS . Also make sure you enable Auto-assign Public IP .
- Am naming three servers as MasterNode , GlusterFS-01, GlusterFS-01, easy for understanding.
- Note down public IP for MasterNode , GlusterFS-01, GlusterFS-01
Step 2
- First SSH into GlusterFS-01. Get root privilages to run command
sudo su -
wget https://raw.githubusercontent.com/anuvindhs/How-to-install-GlusterFS/main/install.sh
chmod u+x install.sh
./install.sh
Info | Screenshots |
---|---|
Enter your Server Name | |
System will Automatically Update Ubuntu | |
Installing GlusterFS and Dependencies , once installed restart the servers | |
If you wish to see the installation data |
- Do this for GlusterFS-02 and MasterNode
Now you have success fully installed GlusterFS
Peering GlusterFS 🤝🏼
This is really important , we need to configure the hostname for all three servers
On each server type
sudo nano /etc/hosts/
Nodes | /etc/hosts data |
---|---|
MasterNode | |
GlusterFS-01 | |
GlusterFS-02 |
MasterNode
52.62.40.54 MasterNode
54.252.253.181 GlusterFS-01
13.236.188.52 GlusterFS-02
GlusterFS-01
127.0.0.1 GlusterFS-01
52.62.40.54 MasterNode
13.236.188.52 GlusterFS-02
GlusterFS-02
52.62.40.54 MasterNode
54.252.253.181 GlusterFS-01
13.236.188.52 GlusterFS-02
make sure you add your public ip
now lets ping all nodes from all servers
ping Masternode
ping GlusterFs-01
ping GlusterFS-02
if all servers pings successfully, we are going to peer the servers now
Go to Masternode
gluster peer probe GlusterFS-01
gluster peer probe GlusterFS-02
Creating Gluster Volume 💽
On Masternode
sudo gluster volume create gv0 replica 3 transport tcp Masternode:/glusterfs glusterfs-01:/glusterfs glusterfs-02:/glusterfs force
sudo gluster volume start gv0
Congratulations 🎉 you have successfully configured the GlusterFS
Testing Gluster-FS replication
lets check the gluster volume info
Create folder for replication test 📁
sudo mkdir -p /myfiles
Mount the /GlusterFS to /myfiles Folder
sudo mount -t glusterfs Masternode:/glusterfs /myfiles
cd /myfiles
sudo touch file_{0..9}.test
ls /glusterfs
You will be able to see the replicated files on each server
Top comments (0)