介绍
**Gluster**是一个大尺度文件系统。
主要功能
简单卷
- distribute volume 分布式卷,两台主机的磁盘融合一个磁盘
- stripe volume 条带卷,一个文件分成数据块存储到不同的地方
- replica volume 复制卷,一个文件分别保存到两台主机
复合卷
1+2,1+3,2+3,1+2+3
总结常用命令
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| gluster peer status gluster volume list gluster volume list
gluster volume create swarm-volume replica 3 worker:/xuan/docker/gluster-volume home:/xuan/docker/gluster-volume xuanps:/xuan/docker/gluster-volume force gluster volume start swarm-volume gluster volume stop swarm-volume gluster volume delete swarm-volume
mount -t glusterfs worker:/swarm-volume /mnt/ umount worker:/swarm-volume
systemctl stop glusterd rm -rf /var/lib/glusterd/ systemctl start glusterd
gluster peer detach home
|
安装
准备工作:
三台局域网主机(centos7 修改主机名 )
hostname |
ip |
备注 |
xuanps |
10.14.0.1 |
|
worker |
10.14.0.4 |
|
home |
10.14.0.5 |
|
三台都需要安装GlusterFS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| yum search centos-release-gluster
yum -y install centos-release-gluster
yum --enablerepo=centos-gluster*-test install glusterfs-server glusterfs -V systemctl enable glusterd systemctl start glusterd systemctl status glusterd
vim /etc/hosts
10.14.0.1 xuanps 10.14.0.4 worker 10.14.0.5 home
gluster peer probe worker gluster peer probe home
gluster peer status
gluster volume info
gluster volume create volume-name replica 3 worker:/xuan/docker/gluster-volume/test home:/xuan/docker/gluster-volume/test xuanps:/xuan/docker/gluster-volume/test force
gluster volume start volume-name
gluster volume set volume-name nfs.disable off
mount -t glusterfs worker:/volume-name /mnt/
|
参考
官网:https://www.gluster.org/
文档
centos官方安装手册
基于 GlusterFS 实现 Docker 集群的分布式存储