Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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...

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

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
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:

##CLIENT 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

#mount
mkdir -p /mnt/glusterfs
mount -a
share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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