本文介绍在CentOS 8/CentOS 7操作系统上安装GlusterFS的方法,在CentOS 8上安装GlusterFS与在CentOS 7上安装有所不同,首先你得先更新系统,运行sudo yum -y update命令,然后运行sudo reboot命令重新启动系统即可。关于GlusterFS的介绍可参考存储系统Ceph、MooseFS、GlusterFS、HDFS、DRBD介绍。
添加GlusterFS存储库 在所有服务器上下载GlusterFS存储库,由于它是最新的稳定版本,因此我们将使用GlusterFS 6: CentOS 8: sudo yum -y install wget sudo wget -O /etc/yum.repos.d/glusterfs-rhel8.repo https://download.gluster.org/pub/gluster/glusterfs/6/LATEST/CentOS/glusterfs-rhel8.repo CentOS 7: sudo yum -y install centos-release-gluster6 添加存储库后,请更新YUM索引: sudo yum makecache
安装GlusterFS的方法 1、在CentOS 8上安装GlusterFS: 启用PowerTools存储库及安装,运行以下命令: sudo dnf -y install dnf-utils sudo yum-config-manager --enable PowerTools sudo dnf -y install glusterfs-server 2、在CentOS 7上安装GlusterFS: 在所有节点上运行以下命令以在CentOS 7上安装最新的GlusterFS: sudo yum -y install glusterfs-server 确认已安装的软件包版本: $ rpm -qi glusterfs-server Name:glusterfs-server Version:6.5 Release:2.el8 Architecture:x86_64 Install Date:Tue 19 Nov 2019 06:58:16 PM EAT Group:Unspecified Size:6560178 License:GPLv2 or LGPLv3+ Signature:RSA/SHA256, Wed 28 Aug 2019 03:39:40 PM EAT, Key ID 43607f0dc2f8238c Source RPM:glusterfs-6.5-2.el8.src.rpm Build Date:Wed 28 Aug 2019 03:27:19 PM EAT Build Host:buildhw-09.phx2.fedoraproject.org Relocations:(not relocatable) Packager:Fedora Project Vendor:Fedora Project URL:http://docs.gluster.org/ Bug URL:https://bugz.fedoraproject.org/glusterfs Summary:Distributed file-system server 你也可以使用gluster命令检查版本: $ gluster --version glusterfs 6.5 Repository revision: git://git.gluster.org/glusterfs.git Copyright (c) 2006-2016 Red Hat, Inc. 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. $ glusterfsd --version
在CentOS 8/CentOS 7上启动GlusterFS服务 在CentOS 8/CentOS 7操作系统上安装GlusterFS服务后,启动并启用该服务: sudo systemctl enable --now glusterd.service 加载Heketi所需的所有内核模块: for i in dm_snapshot dm_mirror dm_thin_pool; do sudo modprobe $i done 如果你有活动的Firewalld服务,请允许GlusterFS使用端口: sudo firewall-cmd --add-service=glusterfs --permanent sudo firewall-cmd --reload 检查所有节点上的服务状态: $ systemctl status glusterd
探测集群中的其他节点: [root@gluster01 ~]# gluster peer probe gluster02 peer probe: success. [root@gluster01 ~]# gluster peer probe gluster03 peer probe: success. [root@gluster01 ~]# gluster peer status Number of Peers: 2 Hostname: gluster02 Uuid: ebfdf84f-3d66-4f98-93df-a6442b5466ed State: Peer in Cluster (Connected) Hostname: gluster03 Uuid: 98547ab1-9565-4f71-928c-8e4e13eb61c3 State: Peer in Cluster (Connected)
相关主题 |