GlusterFS on CentOS - replicated failover clustered disks storage : a simple steps

GlusterFS is a scalable network file-system. Using common off-the-shelf hardware, you can create large, distributed storage solutions for media streaming, data analysis, and other data- and bandwidth-intensive tasks. GlusterFS is free and open source software.





-- machine details:
 gluster1.techfrozen.com 192.168.111.133
 gluster2.techfrozen.com 192.168.111.132
 client.techfrozen.com 192.168.111.139

-- Do the hostfile entry for name resolution in all three machines (gluster1. gluster2, client)


-- common for gluster1 and gluster2

 service firewalld stop
 chkconfig firewalld off
 service iptables stop
 chkconfig iptables off
 setenforce permissive
 yum update -y
 rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
 wget http://download.gluster.org/pub/gluster/glusterfs/LATEST/EPEL.repo/glusterfs-epel.repo -P /etc/yum.repos.d
 yum -y install glusterfs glusterfs-fuse glusterfs-server
 systemctl start glusterd.service
 systemctl enable glusterd.service

-- Add a separate disk (say /dev/sdb) on both servers (gluster1 and gluster2) and mount them as /glusterfs


   fdisk -l

   fdisk /dev/sdb
   mkfs.ext3 /dev/sdb
   mkdir /glusterfs
   mkdir /glusterfs/replica
   mount /dev/sdb /glusterfs/
   vim /etc/fstab
/dev/sdb /glusterfs ext3 defaults 0 0


-- On gluster1:

 gluster peer probe glusterfs2

-- On gluster2:

 gluster peer probe glusterfs1

-- common for both servers (gluster1 and gluster2)

   gluster peer status
   gluster pool list
   gluster volume status
   gluster volume create vol_replica replica 2 transport tcp gluster1:/glusterfs/replica gluster2:/glusterfs/replica
   gluster volume start vol_replica
   gluster volume info  vol_replica
   
-- On client, create a folder as /gluster1-2
   mount.glusterfs gluster1:/vol_replica /gluster1-2
   vim /etc/fstab
gluster1:/vol_replica /gluster1-2 glusterfs defaults,_netdev 0 0

   df -h

Comments

Popular Posts