Skip to content

Prerequisites

  • CentOS 7 64 bit
  • 1 GB RAM minimum for TEST
  • 8 GB RAM minimum for production use
  • unallocated storage space in an LVM Volume Group (min. 8 GB)
  • two servers (A and B) that can reach each other via IP (here in the same collision domain)
  • XFS as cluster filesystem

Documentation

Setup

  • Set up LVM on both servers (Volume Group vg0 with 100 GiB)

lvcreate -L 100G -n ftpdisk1 vg0

  • Create filesystem on logical volume on both servers

mkfs.xfs /dev/vg0/ftpdisk1

  • Create mount point on both servers

mkdir /mnt/ftpdisk1

  • Mount logical volume on both servers

mount /dev/vg0/ftpdisk1 /mnt/ftpdisk1

  • Create brick directory on mounted volume on both servers

mkdir /mnt/ftpdisk1/brick

  • Download packages on both servers

cd /opt/glusterfs wget -l 1 -nd -nc -r -A.rpm

http://download.gluster.org/pub/gluster/glusterfs/LATEST/RHEL/epel-7/x86_64/

  • Install dependencies

yum install gcc git libacl-devel yum install dbench mock --enablerepo=epel

  • Install gluster on both servers

rpm -i /opt/glusterfs/*.rpm

  • Start glusterd on both servers

glusterd

  • Check both servers over the network

gluster peer probe << respective other IP>>

  • Only on 1 server: set up replica

gluster volume create gv0 replica 2 <<ip or hostname server A>>:/mnt/ftpdisk1/brick <<ip or hostname server B>>:/mnt/ftpdisk1/brick

  • Only on 1 server: start the volume

gluster volume start gv0

Expanding a Replicate Volume

  • Prerequisite is that 2 systems were running in replicate mode and are now being expanded by one element
  • Prepare everything on the new system -> install software, create partitions, etc.
  • On an existing system:

gluster peer probe <<new hostname>>

  • On an existing system:

gluster volume add-brick gv0 replica 3 <<new_hostname>>:/mnt/ftpdisk1/brick2

  • Heal the volume

gluster volume heal gv0

  • Check healing

gluster volume heal gv0 info

Shrinking a Replicate Volume

  • Prerequisite is that 3 systems are running in replicate mode and are now being reduced by one host
  • gluster volume remove-brick gv0 replica 2 <>:/mnt/ftpdisk1/brick2 force