在amazon ec2上安装glusterfs

我在Amazon EC2云上运行的drupal网站。 我的实例使用S3存储dynamic文件。 但是我意识到S3太慢了,可能会导致问题。 我想用glusterfs而不是S3。

要使用glusterfs;

  1. 我应该使用哪种Linux AMI? (我试图在Amazon Linux AMI上安装,但是失败了)
  2. 当我创buildEBS实例时,是否应该添加额外的EBS卷或实例的根EBS卷是否足够? (可以使用root EBS卷作为gluster?)
  3. 将EBS卷添加到在gluster池中使用的同一实例是否明智?还是应该创build一个新的实例来添加额外的存储空间?

亲切的问候…

我已经有几个Amazon Linux AMI实例上运行GlusterFS。 对于你下载的yum .repo文件进行了一些调整。 我正在使用一个单独的卷挂载为/ dev / sdf

关于添加额外的砖块与额外的实例,这两个都是有效的解决scheme,这取决于你正在build立的架构。 更多的服务器意味着更多的带宽,但你付出额外的实例..这是一个很好的写在AWS和GlusterFS: https : //s3.amazonaws.com/aws001/guided_trek/Performance_in_a_Gluster_Systemv6F.pdf

以下是安装glusterfs服务器的方法:

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

我在AWS上的Ubuntu AMI中使用了GlusterFS。

这里是一个博客文章,用于设置超过2个节点的Gluster: http : //www.jamescoyle.net/how-to/435-setup-glusterfs-with-a-replicated-volume-over-2-nodes

一个单一的服务器可以适用于一个单一的网站,但是添加一个新的服务器会给你提供更多的带宽,只提供文件。 与本地存储相比,这将导致性能损失。

您可以在您的根卷上使用GlusterFS,但是我build议您保持根分区非常小,并添加额外的EBS卷以满足您的GlusterFS要求。