欢迎光临
我们一直在努力

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

前言

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

配置yum源,epel源

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

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

网址:阿里云官方镜像站

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

自动草稿
自动草稿

配置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_dbFAILED  
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源

自动草稿
自动草稿

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

自动草稿

转到其下载网址

自动草稿

其中就是各版本的Ceph

自动草稿

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

自动草稿

选择el7,也就是Centos7版本。

自动草稿

将其中这两项的路径写入到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)
 收藏 (0) 打赏

您可以选择一种方式赞助本站

支付宝扫一扫赞助

微信钱包扫描赞助

除特别注明外,本站所有文章均基于CC-BY-NC-SA 4.0原创,转载请注明出处。
文章名称:《Centos7下yum安装Ceph分布式存储教程》
文章链接:https://www.xpn.cc/2137/fy.html
分享到: 更多 (0)

热门推荐

评论 抢沙发

登录

忘记密码 ?