欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Centos7下yum安装Ceph分布式存储教程

程序员文章站 2022-06-24 23:37:38
目录前言配置yum源,epel源配置ceph源安装ceph及组件前言本文讲述了ceph应该如何安装,掌握方法后,可自行选择安装哪个版本的ceph。配置yum源,epel源首先机器需要联网,并且配置网络...

前言

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

配置yum源,epel源

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

注:epel (extra packages for enterprise linux)是基于fedora的一个项目,为“红帽系”的操作系统提供额外的软件包,适用于rhel、centos和scientific linux.

网址:阿里云官方镜像站

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

Centos7下yum安装Ceph分布式存储教程
Centos7下yum安装Ceph分布式存储教程

配置yum源

wget -o /etc/yum.repos.d/centos-base.repo https://mirrors.aliyun.com/repo/centos-7.repo

建立缓存

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源

Centos7下yum安装Ceph分布式存储教程
Centos7下yum安装Ceph分布式存储教程

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

建立缓存,一般不会出错

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

Centos7下yum安装Ceph分布式存储教程

转到其下载网址

Centos7下yum安装Ceph分布式存储教程

其中就是各版本的ceph

Centos7下yum安装Ceph分布式存储教程

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

Centos7下yum安装Ceph分布式存储教程

选择el7,也就是centos7版本。

Centos7下yum安装Ceph分布式存储教程

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

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相关组件

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

安装ceph及相关组件

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

查看ceph版本

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

到此这篇关于centos7下yum安装ceph分布式存储教程的文章就介绍到这了,更多相关centos7安装ceph内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!