Subscribe Us


Breaking

Recent In Voip

Popular

Comments

Recent

HOW TO SET UP Glusterfs on Centos7.3/RHEL7.3(Installation and Configuration)

 



GlusterFS is file system which can scalable to Petabytes of data .It Builds Scalable Network Storage
With the Help of Replication .
GlusterFs is High Performance Data Storage.
Gluster Fs is open Source.
GlusterFs was originally devoloped by Gluster,Inc and Later 2011 acquried by Redhat,Inc.
Ex -Streaming Media Service ,Pandora(Internet radio)

Lab Set up Environment
There are 2 main server 138.68.230.208 (public ip)and 165.227.18.235(public ip) and 165.227.108.197 [public ip](Client)


138.68.230.208 gluster1
165.227.18.235 gluster2
165.227.108.197 gluster3

Terms Need to know for Glusterfs:

1)BRICK:It is Storage file system assigned to a Volume .Filesystem mounted on folder or directory .
Every module in glusterfs is treated as Volume. There are 2 bricks brick1 and brick2 mounted under
/gluster/bricks/brick1/vol1


2)Trusted Storage Pool: A group of  multiple servers which trust each other and form cluster .
In This example : gluster pool list will show Trusted storage Pool.


3)Node- It is a storage server which takes part in trusted storage pool.

4)Volume - which is shared to client over Network . It can be mounted with glusterfs file system


Types of Glusterfs Volume Storage :
1) Replicated   -Replicated is basically raid 1  i.e mirror copy the same files distributed to other nodes.If file is written on one it will get replicated to other bricks.

2) Distributed - Distributed is basically files will be distributed across bricks. when no option is specified detributed volume will be created.

3)Stripped- larger files are broken in chunks and then distributed across bricks.Stripe Volume is one in which data is strored in backend is striped into units of particular sizes,among the bricks.


4) Distribute Replicated :Files are distributed along bricks and then replicated to other bricks.

Now I will configure Replicated Gluster Storage.

STEP1: Make entry in /etc/hosts

138.68.230.208 gluster1
165.227.18.235 gluster2
165.227.108.197 gluster3
in each machine gluster1 gluster2 gluster3.

I set host name by using command
hostnamectl set-hostname gluster1
hostnamectl set-hostname gluster2
hostnamectl set-hostname gluster3
STEP 2: Disable selinux and allow these ports if having firewall 24007,24008(RDMA),111,2049,49152-49155.



STEP3: downdoad glusterfs

under /etc/yum.repos.d/ create a file gluster.repo

[gluster3.10]
name = Gluster 3.10
baseurl = http://mirror.centos.org/centos/7/storage/$basearch/gluster-3.10/
gpgcheck = 0
enabled=1


yum -y install glusterfs glusterfs-server glusterfs-fuse

STEP4:


systemctl start glusterd
systemctl enable glusterd

for gluster1 run these commands
gluster peer probe gluster2
gluster peer status
gluster pool list


for gluster2 run these commands.

gluster peer probe gluster1
gluster peer status
gluster pool list




STEP5:Creating physical volume(PV) ,Volume group(VG)and logical Volume(LV).



.pvcreate /dev/sda
vgcreate vg01 /dev/sdb1
lvcreate -l 100%FREE -n lv01 vg01
mkfs.xfs /dev/mapper/vg01-lv01

Create a mount point for brick directory.


 mkdir -p /gluster/bricks/brick1

To mount the brick do entry in /etc/fstab


/dev/mapper/vg01-lv01    /gluster/bricks/brick1  xfs     defaults  0 0


run mount -a command


df -Th




STEP6:Creating gluster FS volume.

make mount point /vol1 under /gluster/bricks/brick1
mkdir /gluster/bricks/brick1/vol1

STEP7: FOR Creating replicated volume .


gluster volume create replvol replica 2 gluster1:/gluster/bricks/brick1/vol1 gluster2:/gluster/bricks/brick1/vol1

Now need to start volume .


#gluster volume start replvol


STEP8: gluster volume info replvol

Run on gluster1
gluster volume info replvol



Now run command to see brick mount point on gluster2.

gluster volume info replvol




STEP9: ON Client side gluster3 install glusterfs-client.

create file under /etc/yum.repos.d/gluster.repo



[gluster3.10]
name = Gluster 3.10
baseurl = http://mirror.centos.org/centos/7/storage/$basearch/gluster-3.10/
gpgcheck = 0
enabled=1

Install Package


yum -y install glusterfs-client

STEP 10 : Create folder /data


mkdir /data

STEP11 : Mounting glusterfs Client under mount point /data


mount -t glusterfs gluster1:/replvol /data

permanent mount under /etc/fstab

gluster1:/replvol /data glusterfs defaults,_netdev 0 0
run mount -a

Now see Replication  create file vi pcfunda.txt under client gluster3. under /data and gluster1 15GB disk gets mounted on gluster3 client node .


Now got to gluster2  and see same file pcfunda.txt under /gluster/bricks/brick1/vol1




Now go to Gluster 1 and see same pcfunda.txt


RESULT : we created pcfunda.txt on gluster3 now Same file replicated under gluster1 ,gluster2 .

any file ,folder you create or store any things on any of nodes gluster1,gluster2 and gluster3 ,then same will replicated to all other nodes.

Comments  and feedback are Highy appreciated.

Distributed ,stripped and Distributed Replicated   will explain in next blog (Coming Soon)

0 on: "HOW TO SET UP Glusterfs on Centos7.3/RHEL7.3(Installation and Configuration)"