Gluster FS – One Click Install

DAY 3 – GlusterFS on Cloudcover

☁️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

TypeProtocolPortsSourceDescription
SSHSSH22Administration Host Security GroupAdministration Host Security Group
Custom TCP RuleTCP2007GlusterFS Security Group Secure Transport Server Security GroupGluster Daemon
Custom TCP RuleTCP111GlusterFS Security Group SecureTransport Server Security GroupPortmapper
Custom TCP RuleTCP49152-49251GlusterFS Security Group SecureTransport Server Security GroupEach brick for every volume on your host requires its own port
Custom TCP RuleTCP2049GlusterFS Security Group SecureTransport Server Security GroupNFS

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
 install sh
InfoScreenshots
Enter your Server NameServerName
System will Automatically Update UbuntuOS update
Installing GlusterFS and Dependencies , once installed restart the serversGFS
If you wish to see the installation datadebug
  • 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
MasterNodemsnode
GlusterFS-01gfs01
GlusterFS-02Image description

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
 

peer

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

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