My drupal website running on Amazon EC2 cloud. My instances use S3 storage for dynamic files. But I realized that S3 is too slow and it may cause problems. I want to use glusterfs instead of S3.

To use glusterfs;

  1. Which Linux AMI should I use? (I tried to install it on Amazon Linux AMI but I failed)
  2. When I create EBS instance, should I add extra EBS volume or instance's root EBS volume is enough? (is it possible to use root EBS volume as gluster?)
  3. Is it wise to add EBS volumes to same instance to use in gluster pool or should I create a new instance to add extra storage?

Kind regards...


I've got GlusterFS running on several Amazon Linux AMI instances. It took some some tweaking to the yum .repo file they have you download though. I'm using a seperate volume mounted as /dev/sdf

Regarding adding extra bricks vs extra instances, both are valid solutions, it depends on what architecture you're setting up. More servers means more bandwidth, but youre paying for the extra instance.. Here's a good writeup on AWS & GlusterFS: https://s3.amazonaws.com/aws001/guided_trek/Performance_in_a_Gluster_Systemv6F.pdf

Here's what should get the glusterfs server installed:

#installing gluster
sudo su -

#install xfs tools
yum install -y xfsprogs

#install glusterfs repo
wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/LATEST/EPEL.repo/glusterfs-epel.repo
#fix it for amazon linux
sed -i 's/$releasever/6/g' /etc/yum.repos.d/glusterfs-epel.repo 

#create a new primary partition of the whole volume - enter n,p,1,enter,enter
fdisk /dev/sdf 

#format new partion
mkfs.xfs -i size=512 /dev/sdf1
#setup mount point 
mkdir -p /export/brick1

#setup fstab for brick
echo "/dev/sdf1 /export/brick1 xfs defaults 1 2" >> /etc/fstab

mount -a

#install glusterfs
yum install -y glusterfs{-fuse,-server}

#start glusterfs
service glusterd start

#turn on auto-start
chkconfig glusterd on

#peer with other servers if necessary  
#gluster peer probe hostname2.example.com

#setup the volume
gluster volume create media-volume hostname.example.com:/export/brick1
gluster volume start media-volume
gluster volume info

Client side install:

#installing gluster
sudo su -

#install glusterfs repo
wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/LATEST/EPEL.repo/glusterfs-epel.repo
#fix it for amazon linux
sed -i 's/$releasever/6/g' /etc/yum.repos.d/glusterfs-epel.repo 

#install glusterfs
yum install -y glusterfs-fuse

#setup fstab
echo "hostname.example.com:/media-volume /mnt/glusterfs glusterfs defaults 0 0" >> /etc/fstab

mkdir -p /mnt/glusterfs
mount -a
  • 1
    It looks like the link to download the repo file is broken. – grayaii Jul 6 '18 at 7:47

I have used GlusterFS in a Ubuntu AMI on AWS.

Here is a blog post for setting up Gluster over 2 nodes: http://www.jamescoyle.net/how-to/435-setup-glusterfs-with-a-replicated-volume-over-2-nodes

A single server will be fine for a single website, however adding a new server will give you more bandwidth for only serving files. This would incur a performance penalty compared with local storage.

You can use GlusterFS on your root volume, however I'd recommend keeping your root partition very small and adding extra EBS volumes to cater for your GlusterFS requirements.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.