Pages

Monday, March 23, 2015

Creating Replicated Volumes with Gluster FS

In the following scenario we are replicating a particular details from one  server to another server using GlusterFS replicated Volumes.

Mount the partition
On Both the Server's
mkfs.ext3 /dev/sdb1
mkdir /root/glusterfs
mount /dev/sdb1 /root/glusterfs/
tail -n 1 /etc/mtab >> /etc/fstab
mkdir /root/glusterfs/images


How to Enable EPEL Repository in RHEL/CentOS
Next, we need to enable GlusterFs repository on both servers.

wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/LATEST/EPEL.repo/glusterfs-epel.repo
yum install glusterfs-server -y
service glusterd start
chkconfig glusterd on


#Configure the Trusted Pool
#Run the following command on ‘Server1‘.
gluster peer probe controller2
#Run the following command on ‘Server2‘.
gluster peer probe controller1
#Note: Once this pool has been connected, only trusted users may probe new servers into this pool.
gluster peer status


#Step 6: Set up a GlusterFS Volume
#On both server1 and server2.
#Create a volume On any single server and start the volume. Here, I’ve taken ‘Server1‘.

 gluster volume create images replica 2 controller1:/root/gluster/images controller2:/root/gluster/images

 gluster volume create images replica 2 network1:/root/gluster/openvswitch network2:/root/gluster/openvswitch
mount.glusterfs 192.168.216.145:images /etc/openvswitch/
 gluster volume start images

# Next, confirm the status of volume.
gluster volume info

chkconfig glusterd on


 echo "
 mount.glusterfs 192.168.216.135:images /var/lib/glance/images/
 " >> /etc/rc.local

 mount.glusterfs 192.168.216.135:images /var/lib/glance/images/
chown glance.glance /var/lib/glance/images -R
chmod g+s /var/lib/glance/images
chmod 775 /var/lib/glance -R

No comments:

Post a Comment