系统城装机大师 - 固镇县祥瑞电脑科技销售部宣传站!

当前位置:首页 > server > anz > 详细页面

脚本之家推荐Centos7下yum安装Ceph分布式存储教程

时间:2021-11-29来源:www.pcxitongcheng.com作者:电脑系统城

本文讲述了Ceph应该如何安装,掌握方法后,可自行选择安装哪个版本的Ceph。

配置yum源,epel源

首先机器需要联网,并且配置网络yum源,epel源,可从阿里开源镜像站中下载源文件。

注:EPEL (Extra Packages for Enterprise Linux)是基于Fedora的一个项目,为“红帽系”的操作系统提供额外的软件包,适用于RHEL、CentOS和Scientific Linux.

网址:阿里云官方镜像站

例如:我所使用的是Centos7,接下来给对应版本的linux下载yum源,epel源。

在这里插入图片描述
在这里插入图片描述

配置yum源

1 wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

建立缓存

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
yum makecache
已加载插件:fastestmirror, langpacks
Determining fastest mirrors
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
base                                                  | 3.6 kB     00:00    
extras                                                | 2.9 kB     00:00    
updates                                               | 2.9 kB     00:00    
base/7/x86_64/primary_db       FAILED                                         
http://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/repodata/f09552edffa70f49f553e411c2282fbccfffbeafa21e81e32622b103038b8bae-primary.sqlite.bz2: [Errno 14] curl#6 - "Could not resolve host: mirrors.cloud.aliyuncs.com; Unknown error"
正在尝试其它镜像。
(1/10): base/7/x86_64/group_gz                          | 153 kB   00:00    
(2/10): extras/7/x86_64/filelists_db                    | 205 kB   00:00    
(3/10): extras/7/x86_64/other_db                        | 122 kB   00:00    
(4/10): base/7/x86_64/other_db                          | 2.6 MB   00:00    
(5/10): updates/7/x86_64/filelists_db                   | 1.3 MB   00:00    
(6/10): updates/7/x86_64/other_db                       | 195 kB   00:00    
(7/10): base/7/x86_64/primary_db                        | 6.1 MB   00:00    
base/7/x86_64/filelists_db     FAILED                                         
http://mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/6882feea31727f25dc12063b4bab119501d25dbf6cb6fa0f5b78b8e3d5401ea4-filelists.sqlite.bz2: [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; Connection refused"
正在尝试其它镜像。
extras/7/x86_64/primary_db     FAILED                                         
http://mirrors.aliyuncs.com/centos/7/extras/x86_64/repodata/42c5d8fe33ef3f1ab94d1ae257bc56201267d8af60132e3d778e586693e50a8f-primary.sqlite.bz2: [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; Connection refused"
正在尝试其它镜像。
updates/7/x86_64/primary_db    FAILED                                         
http://mirrors.aliyuncs.com/centos/7/updates/x86_64/repodata/9700f154a034cedf59ca9c4f0a1466cc4dccaeb7db2e20b7e247e9e8a3a5fbc5-primary.sqlite.bz2: [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; Connection refused"
正在尝试其它镜像。
(8/10): extras/7/x86_64/primary_db                      | 194 kB   00:00    
(9/10): base/7/x86_64/filelists_db                      | 7.1 MB   00:00    
(10/10): updates/7/x86_64/primary_db                    | 2.1 MB   00:00    
元数据缓存已建立

不使用阿里云的ECS,就会出现Couldn't resolve host 'mirrors.cloud.aliyuncs.com信息,但不影响其正常使用。

配置epel源

在这里插入图片描述
在这里插入图片描述

1 wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

建立缓存,一般不会出错

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
yum makecache
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
base                                                  | 3.6 kB     00:00    
epel                                                  | 4.7 kB     00:00    
extras                                                | 2.9 kB     00:00    
updates                                               | 2.9 kB     00:00    
(1/6): epel/x86_64/group_gz                             |  95 kB   00:00    
(2/6): epel/x86_64/updateinfo                           | 1.0 MB   00:00    
(3/6): epel/x86_64/prestodelta                          | 4.0 kB   00:00    
(4/6): epel/x86_64/primary_db                           | 6.8 MB   00:01    
(5/6): epel/x86_64/other_db                             | 3.3 MB   00:00    
(6/6): epel/x86_64/filelists_db                         |  12 MB   00:02    
元数据缓存已建立

配置Ceph源

在阿里云开源镜像站中找到Ceph

在这里插入图片描述

转到其下载网址

在这里插入图片描述

其中就是各版本的Ceph

在这里插入图片描述

例如,下载其中的rpm-15.2.2/版本的Ceph

在这里插入图片描述

选择el7,也就是Centos7版本。

在这里插入图片描述

将其中这两项的路径写入到Ceph源文件,其目录内就是具体的软件包

1
2
3
4
5
6
7
8
9
10
11
12
cat >>/etc/yum.repos.d/ceph.repo<< eof
[ceph]  #路径为以上的x86_64目录
name=ceph
baseurl=https://mirrors.aliyun.com/ceph/rpm-15.2.2/el7/x86_64/
gpgcheck=0
enabled=1
[ceph-noarch]   #路径为以上noarch目录
name=ceph-noarch
baseurl=https://mirrors.aliyun.com/ceph/rpm-15.2.2/el7/noarch/
gpgcheck=0
enabled=1
eof

安装Ceph及组件

安装epel-release及yum相关组件

1 yum -y install epel-release yum-plugin-priorities yum-utils

安装Ceph及相关组件

1 yum install -y ceph-deploy ceph ceph-radosgw snappy leveldb gdisk python-argparse gperftools-libs

查看ceph版本

1
2
ceph -v
ceph version 15.2.2 (0c857e985a29d90501a285f242ea9c008df49eb8) octopus (stable)

到此这篇关于Centos7下yum安装Ceph分布式存储教程的文章就介绍到这了

分享到:

相关信息

系统教程栏目

栏目热门教程

人气教程排行

站长推荐

热门系统下载