glusterfs分布式文件系统用作文件同步安装配置

时间:2021-11-28 08:27:16


rpm包安装

官方站点:http://download.gluster.org/pub/gluster/glusterfs/

yum install centos-release-gluster

======================================
# mkfs.xfs -i size=512 /dev/sdb1
# mkdir -p /bricks/brick1
# vi /etc/fstab
/dev/sdb1 /bricks/brick1 xfs defaults 1 2
# mount -a && mount
========================================
yum install xfsprogs
yum --enablerepo=centos-gluster*-test install glusterfs-server
service glusterd start

gluster peer probe gv02
gluster peer status 
mkdir /data/repository
gluster volume create gv0 replica 2 gv01:/data/repository gv02:/data/repository
gluster volume start gv0
gluster volume info

mount -t glusterfs gv01:/gv0 /mnt
mount -t glusterfs gv02:/gv0 /mnt
for i in `seq -w 1 100`; do cp -rp /var/log/messages /mnt/copy-test-$i; done

查看同步情况
ls -lA /mnt | wc -l
ls -lA

创建卷时报错 volume create: gv0: failed: /data/gv0/brick1 or a prefix of it is already part of a volume
A:之前创建卷时,报错,
volume create: gv0: failed
因此,有信息遗留,需要清理。
# cd /data/gv0/brick1
# attr -lq .
glusterfs.volume-id
# setfattr -x trusted.glusterfs.volume-id .
 
或者批量:
# cd /data/gv0
# for i in `ls .`; do setfattr -x trusted.glusterfs.volume-id $i; done


http://www.cnblogs.com/terrycy/p/5915263.html
http://nosmoking.blog.51cto.com/3263888/1697954
http://blog.csdn.net/lincoln_2012/article/details/52201227
http://www.cnblogs.com/terrycy/p/5915263.html
http://www.centoscn.com/image-text/config/2015/0901/6098.html
http://www.cnblogs.com/terrycy/p/5915263.html