open stack--GFS-cluster部署与实践
一、前期准备
(1)条件:准备3台linux系统,确认 DNS 能够解析各node或在/etc/hosts配置各node 的FQDN、IP、别名
cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.10.60 con1
192.168.10.61 con2
192.168.10.62 con3
(2)配置yum源:
yum -y install centos-release-gluster40
二、部署环境:
(1)所有server节点建立操作,安装GFS SERVER
yum install glusterfs-server -y
(2)所有server节点开启 GFS 服务
systemctl start glusterd
systemctl enable glusterd
三、GFS实践
1、实现 GFS 之 Distributed
(1)建立 GlusterFS 卷所需要的目录
mkdir -pv /gfs/dist
(2)将 node 加入至 gfs 集群组中
gluster peer probe con2
gluster peer probe con3
(3)确认集群组状态
gluster peer status
(4) 创建 Distributed Volume
gluster volume create vol_dist transport tcp \
con1:/gfs/dist \
con2:/gfs/dist \
con3:/gfs/dist force
(5)启动卷
gluster volume start dist
(6)查看卷信息
gluster volume info
(7)客户端配置
安装软件包:
yum install glusterfs glusterfs-fuse -y
创建挂着目录:
mkdir -pv /mnt/gfs/dist
挂载共享存储:
mount -t glusterfs con1:/vol_dist /mnt/gfs/dist/
查看挂载情况,并复制或创建文件进行测试:
df -hT
2、实现 GFS 之 Replication
(1)建立 GlusterFS 卷所需要的目录
mkdir -pv /gfs/replica
(2)将 node2 node3 加入至 gfs 集群组中
gluster peer probe con2
gluster peer probe con3
(3)确认集群组状态
gluster peer status
(4)创建 Replication Volume
gluster volume create vol_replica replica 3 transport tcp \
con1:/gfs/replica \
con2:/gfs/replica \
con3:/gfs/replica force
(5)启动并查看卷信息
gluster volume start vol_replica
gluster volume info
(6)客户端配置
安装软件包:
yum install glusterfs glusterfs-fuse -y
创建挂着目录:
mkdir -pv /mnt/gfs/replica
挂载共享存储:
mount -t glusterfs con1:/vol_replica /mnt/gfs/replica
查看挂载情况,并复制或创建文件进行测试
df -hT
3、实现 GFS 之 Striping
(1)建立 GlusterFS 卷所需要的目录
mkdir -pv /gfs/spriped
(2)将 node2 node3 加入至 gfs 集群组中
gluster peer probe con2
gluster peer probe con3
(3)确认集群组状态
gluster peer status
(4)创建 Striping Volume
gluster volume create vol_spriped stripe 3 transport tcp \
con1:/gfs/spriped \
con2:/gfs/spriped \
con3:/gfs/spriped force
(5)启动并查看卷信息
gluster volume start vol_spriped
gluster volume info
(6)客户端配置
安装软件包:
yum install glusterfs glusterfs-fuse -y
创建挂着目录:
mkdir -pv /mnt/gfs/striping
挂载共享存储:
mount -t glusterfs con1:/vol_spriped /mnt/gfs/striping
查看挂载情况,并复制或创建文件进行测试
df -hT
4、实现 GFS 之 Dist+Replica
(1)建立 GlusterFS 卷所需要的目录
mkdir -pv /gfs/dr
(2)将 node2 node3 node4 加入至 gfs 集群组中
gluster peer probe con2
gluster peer probe con3
gluster peer probe con4
(3)确认集群组状态
gluster peer status
(4)创建 Dist+Replica Volume
gluster volume create vol_dr replica 2 transport tcp \
con1:/gfs/dr \
con2:/gfs/dr \
con3:/gfs/dr \
con4:/gfs/dr force
(5)启动并查看卷信息
gluster volume start vol_dr
gluster volume info
(6)客户端配置
安装软件包:
yum install glusterfs glusterfs-fuse -y
创建挂着目录:
mkdir -pv /mnt/gfs/dr
挂载共享存储:
mount -t glusterfs con1:/vol_dr /mnt/gfs/dr
查看挂载情况,并复制或创建文件进行测试:
df -hT
5、实现 GFS 之 Stripe+Replica
(1)建立 GlusterFS 卷所需要的目录
mkdir -pv /gfs/sr
(2)将 node2 node3 node4 加入至 gfs 集群组中
gluster peer probe con2
gluster peer probe con3
gluster peer probe con4
(3)确认集群组状态
gluster peer status
(4)创建 Stripe+Replica Volume
gluster volume create vol_sr stripe 2 replica 2 transport tcp \
con1:/gfs/sr \
con2:/gfs/sr \
con3:/gfs/sr \
con4:/gfs/sr force
(5)启动并查看卷信息
gluster volume start vol_sr
gluster volume info
(6)客户端配置
安装软件包:
yum install glusterfs glusterfs-fuse -y
创建挂着目录:
mkdir -pv /mnt/gfs/sr
挂载共享存储:
mount -t glusterfs con1:/vol_sr /mnt/gfs/sr
查看挂载情况,并复制或创建文件进行测试
df -hT