Installing GlusterFS on HP Cloud

Feb 27 2013

Gluster is a distributed filesystem that works well in the cloud. This post explains how to configure GlusterFS on an Ubuntu 12.04 image running in HP's cloud.

Using this setup, I gain all the benefits of a distributed and replicated (redundant) filesystem for my in-cloud services, and can back these servers to persistent block storage if I want. It's a great way to gain stable networked filesystems in the cloud, and reduce or eliminate single points of failure.
<!--break-->

Prerequisites

In this article, I'm using HP Cloud. I assume that one has an acocunt, and has basic knowledge of security groups, servers, and so on.

I am using the hpcloud CLI, which is Open Source, and available from HP Cloud. I assume that hpcloud has already been configured.

Create A Security Group

First, create a new security group for your Gluster servers. I do this with the hpcloud commandline client:

This opens port 22 for SSH, port 24007 for Gluster admin, and ports 24009-24099 for Gluster's filesystem protocol. Note that the last two are restricted to only other compute instances in the GlusterServer group. I am not making any warrants about the security of this setup. Since Gluster does not currently do encryption over the wire, use at your own risk.

Once this server is up and running, SSH into it and install just the FUSE client for GlusterFS:

sudo apt-get install glusterfs-client

From there, you can mount a gluster volume like this:

mount -t glusterfs IP_ONE:/gv0 /mnt

You should be able to go to /mnt and work directly on the GlusterFS volume. The files you create there will be replicated across your new Gluster replicated cluster.

Next Steps

In the example above, I created a two-node cluster using only ephemeral storage. If both of these instances died at the same time, your data would be lost. So for production workloads, you probably want to also create a new block storage volume and use that on at least one of your instances.

Also, keep in mind that GlusterFS does not encrypt traffic over the network. (That's slated to arrive in GlusterFS 2.4 or so.) So there's a level of risk involved in using GlusterFS.