GlusterFS in AWS

挂载Amazon EBS

lsblk
yum install -y xfsprogs
wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/LATEST/EPEL.repo/glusterfs-epel.repo
sed -i 's/$releasever/6/g' /etc/yum.repos.d/glusterfs-epel.repo 
mkfs.xfs -i size=512 /dev/xvdf
mkdir -p /export/xvdf
echo "/dev/xvdf /export/xvdf xfs defaults,nofail,noatime 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
mkdir /export/xvdf/brick1
gluster volume create pcvol 172.31.42.77:/export/xvdf/brick1
gluster volume start pcvol
gluster volume info
gluster volume status

客户端

#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 "172.31.42.77:/pcvol /data_pcvol glusterfs defaults,noatime 0 0" >> /etc/fstab

#mount
mkdir /data_pcvol
mount -a
ls /data_pcvol

参考

  • http://www.gluster.org/documentation/quickstart/
  • http://blog.gluster.org/category/aws-en/
  • http://serverfault.com/questions/479576/installing-glusterfs-on-amazon-ec2