构建GlusterFS 11 RPM软件仓库¶
由于 下载GlusterFS rpm软件包并构建仓库 实践过程中发现难以在低版本 CentOS 7.2 上部署 GlusterFs 9,所以调整方案,采用 CentOS 7环境编译GlusterFS 11 ,同样也构建自己的安装RPM包仓库。
准备工作¶
已经完成 CentOS 7环境编译GlusterFS 11 ,在
extras/LinuxRPM
有所有编译好的RPM包安装好 createrepo 创建仓库 :
yum install createrepo
创建仓库¶
将所有 CentOS 7环境编译GlusterFS 11 生成在
extras/LinuxRPM
所有编译好的RPM包复制到glusterfs/11.0/CentOS/7.2
目录下(重要)在运行GlusterFS主机上需要社区提供的
userspace-rcu
( CentOS 7环境编译GlusterFS 11 则需要对应的userspace-rcu-devel
),在glusterfs/11.0/CentOS/7.2
目录中下载userspace-rcu
:
wget http://mirror.centos.org/centos-7/7.9.2009/storage/x86_64/gluster-9/Packages/u/userspace-rcu-0.10.0-3.el7.x86_64.rpm
构建索引:
createrepo glusterfs/11.0/CentOS/7.2
执行以下脚本
./glusterfs_repo.sh 192.168.6.200
(这里假设运行repo服务的主机是192.168.6.200
):
cat << EOF > glusterfs-11.repo
[centos-gluster11]
name=CentOS-$releasever - Gluster 11
baseurl=http://REPO:8080/glusterfs/11.0/CentOS/7.2/
enabled=1
gpgcheck=0
EOF
repo=$1
sed -i "s/REPO/$repo/g" glusterfs-11.repo
将生成的
glusterfs-11.repo
复制到所有需要部署安装glusterfs
的服务器上,然后执行以下命令验证仓库是否工作正常:
yum update
yum install glusterfs
如果一切正常,将看到如下输出:
Dependencies resolved.
========================================================================
Package Arch Version Repository Size
========================================================================
Installing:
glusterfs x86_64 11.0-0.0.alios7 centos-gluster11 600 k
Installing dependencies:
libgfrpc0 x86_64 11.0-0.0.alios7 centos-gluster11 74 k
libgfxdr0 x86_64 11.0-0.0.alios7 centos-gluster11 52 k
libglusterfs0 x86_64 11.0-0.0.alios7 centos-gluster11 314 k
userspace-rcu x86_64 0.10.0-3.el7 centos-gluster11 93 k
Transaction Summary
========================================================================
Install 5 Packages
Total download size: 1.1 M
Installed size: 4.2 M
Is this ok [y/N]: