Meeting: 25th March 2013 – Virtualisation Part 2, Storage 1


Virtualisation Part 2 – Storage

GlusterFS

What is GlusterFS

  • Software NAS.
  • GlusterFS is a clustered file system.
  • Similar to RAID in principle but uses physical servers in place of disks.

VIRTUALISATION RECAP

Where did we get to?
  • Built a hypervisor based on KVM and libvirt.
  • Added a second hypervisor for resilience.
  • Used shared storage to hold the virtual hard disks (NFS).
  • Ability to migrate the virtual machines between physical hypervisors.
Problems?

Our setup was not 100% resilient due to storage residing on only 1 host.

A BIT MORE ABOUT GLUSTERFS

  • Simple configuration.
  • Servers classed as bricks.
  • Striping, Mirroring Replication based storage.
  • Load balancing, High availability and failover.
  • Traditional connectivity methods (NFS).

LETS INSTALL!

Server Side

yum install glusterfs glusterfs-server nfs-utils

Client Side

yum install glusterfs glusterfs-fuse

TURN IT ON…

SystemD

systemctl start glusterd.service

systemctl start rpcbind.service

SysV Init

service glusterd start

service rpcbind start

rpcbind is to allow NFS connectivity to the service

CREATE THE VOLUMES

Lets create a directory to host the volume. This is what is classed as a brick. On all servers run:

mkdir /vmstore

On host1 run:

gluster peer probe host2

This makes the hosts become “friends”, add as many hosts here as you like. Note: DNS records or hosts file needs to be in place to allow name resolution.

CONNECTING THE GLUSTER CLUSTER

On host1 the following command will create the glusterfs volume gluster-vmstore:

gluster volume create gluster-vmstore replica 2 host1:/vmstore host2:/vmstore

This uses the directory (/vmstore) we created as a storage brick for our GlusterFS volume

STARTING THE CLUSTER

We must now startup our replicated volume:

gluster volume start gluster-vmstore

The server side configuration of GlusterFS is now complete.

TESTING GLUSTERFS

LETS MOUNT THE VOLUMES

Each node mounts it’s own brick.

mkdir /mnt/gluster

mount localhost:/gluster-vmstore /mnt/gluster

RESULTS

Anything written to /mnt/gluster-vmstore on either host is replicated to the other node(s) in the GlusterFS cluster.

USING THIS WITH LIBVIRT

On host(s):

Add new storage into Virt-Manager, can be NFS or GlusterFS.

Virtual Hard disk files now reside on all Gluster/libvirt nodes.

NEXT STEPS

High Availability/Failover – Heartbeat

Current failover would be manual, automate this to complete the picture

ScreenCast

Because the demo didn’t work correctly at the meet I put together a screen cast of the whole process:


Leave a comment

One thought on “Meeting: 25th March 2013 – Virtualisation Part 2, Storage