snow chuai汇总、整理、撰写---2020/1/30
+----------------------+ | +----------------------+ | [GlusterFS Server#1] |192.168.10.11 | 192.168.10.12| [GlusterFS Server#2] | | node1.1000cc.net +--------------+--------------+ node2.1000cc.net | | | | | | +----------------------+ | +----------------------+ | +----------------------+ | +----------------------+ | [GlusterFS Server#3] |192.168.10.13 | 192.168.10.14| [GlusterFS Server#4] | | node3.1000cc.net +--------------+--------------+ node4.1000cc.net | | | | | | +----------------------+ | +----------------------+ | +----------------------+ | +----------------------+ | [GlusterFS Server#5] |192.168.10.15 | 192.168.10.16| [GlusterFS Server#6] | | node5.1000cc.net +--------------+--------------+ node6.1000cc.net | | | | | | +----------------------+ | +----------------------+ | |192.168.10.17 +-----------+---------+ | [GlusterFS Client] | | node7.1000cc.net | | | +---------------------+
1) 安装GFS Server到所有节点 [root@node1 ~]# vim host-list.txt node1.1000cc.net node2.1000cc.net node3.1000cc.net
[root@node1 ~]# pssh -h host-list.txt -i 'yum install centos-release-gluster6 -y' [root@node1 ~]# sed -i "s/enabled=1/enabled=0/g" /etc/yum.repos.d/CentOS-Gluster-6.repo [root@node1 ~]# pscp.pssh -h host-list.txt /etc/yum.repos.d/CentOS-Gluster-6.repo /etc/yum.repos.d/ [1] 14:10:38 [SUCCESS] node1.1000cc.net [2] 14:10:38 [SUCCESS] node2.1000cc.net [3] 14:10:38 [SUCCESS] node3.1000cc.net
[root@node1 ~]# pssh -h host-list.txt -i 'yum --enablerepo=centos-gluster6 install glusterfs-server -y' [root@node1 ~]# pssh -h host-list.txt -i 'systemctl enable --now glusterd' 1] 14:13:07 [SUCCESS] node1.1000cc.net [2] 14:13:07 [SUCCESS] node2.1000cc.net [3] 14:13:08 [SUCCESS] node3.1000cc.net
[root@node1 ~]# gluster --version glusterfs 6.7 Repository revision: git://git.gluster.org/glusterfs.git Copyright (c) 2006-2016 Red Hat, Inc. <https://www.gluster.org/> GlusterFS comes with ABSOLUTELY NO WARRANTY. It is licensed to you under your choice of the GNU Lesser General Public License, version 3 or any later version (LGPLv3 or later), or the GNU General Public License, version 2 (GPLv2), in all cases as published by the Free Software Foundation.
2) 防火墙配置 [root@node1 ~]# firewall-cmd --add-service=glusterfs --permanent success [root@node1 ~]# firewall-cmd --reload success
1) 建立dist vol目录 [root@node1 ~]# pssh -h host-list.txt -i 'mkdir -p /gfs/dist' [1] 14:19:55 [SUCCESS] node2.1000cc.net [2] 14:19:55 [SUCCESS] node1.1000cc.net [3] 14:19:55 [SUCCESS] node3.1000cc.net |
1) 安装GFS源及相关软件 [root@node7 ~]# yum install centos-release-gluster6 -y [root@node7 ~]# sed -i "s/enabled=1/enabled=0/g" /etc/yum.repos.d/CentOS-Gluster-6.repo [root@node7 ~]# yum --enablerepo=centos-gluster6 install glusterfs glusterfs-fuse -y |
1) 请先完成Distributed配置 |
1) 安装Gluster工具并启动Gluster服务 [root@node4 ~]# yum install centos-release-gluster6 -y |
1) 查看卷信息 [root@node1 ~]# gluster volume info Volume Name: dist_vol Type: Distribute Volume ID: 89287b49-1c7c-4331-bbe0-f5182d807085 Status: Started Snapshot Count: 0 Number of Bricks: 4 Transport-type: tcp Bricks: Brick1: node1:/gfs/dist Brick2: node2:/gfs/dist Brick3: node3:/gfs/dist Brick4: node4:/gfs/dist Options Reconfigured: transport.address-family: inet storage.fips-mode-rchecksum: on nfs.disable: on |
1) 停止Vol [root@node1 ~]# gluster volume stop dist_vol Stopping volume will make its data inaccessible. Do you want to continue? (y/n) y volume stop: dist_vol: success |
1) 配置Replication模式 [root@node1 ~]# pssh -h host-list.txt -i 'mkdir -p /gfs/replica' | grep -v Stderr | grep -v 'open termainl' [1] 14:20:32 [SUCCESS] node1.1000cc.net [2] 14:20:32 [SUCCESS] node2.1000cc.net [3] 14:20:32 [SUCCESS] node3.1000cc.net |
1) 配置Dist+Rep [root@node1 ~]# pssh -h host-list.txt -i ' mkdir -p /gfs/dr' [1] 15:09:31 [SUCCESS] node1.1000cc.net [2] 15:09:31 [SUCCESS] node2.1000cc.net [3] 15:09:31 [SUCCESS] node3.1000cc.net [4] 15:09:31 [SUCCESS] node4.1000cc.net [5] 15:09:31 [SUCCESS] node6.1000cc.net [6] 15:09:31 [SUCCESS] node5.1000cc.net |
1) 建立存储目录 [root@node1 ~]# pssh -h host-list.txt -i ' mkdir -p /gfs/disp' [1] 15:22:47 [SUCCESS] node1.1000cc.net [2] 15:22:47 [SUCCESS] node2.1000cc.net [3] 15:22:47 [SUCCESS] node4.1000cc.net [4] 15:22:47 [SUCCESS] node5.1000cc.net [5] 15:22:47 [SUCCESS] node3.1000cc.net [6] 15:22:47 [SUCCESS] node6.1000cc.net |