优选主流主机商
任何主机均需规范使用

CentOS 7.0 安装 Ceph Jewel 及更高版本详细教程与实例解析

背景

由于docker的Ceph插件rexray对Ceph版本有一定的要求,当Ceph版本为hammer (0.94.10)时,rexray无法成功创建rbd设备。CentOS 7及以上版本,默认安装的就是hammer版本,因此,我们需要安装更高的jewel版本。Ceph的版本可参见。

安装

为了安装速度,我们可以选用国内源。通常大家使用的国内源包括:

  • 网易 http://mirrors.163.com/ceph
  • 中科大 http://mirrors.ustc.edu.cn/ceph
  • 阿里 http://mirrors.aliyun.com/ceph

添加源

给yum增加一个Ceph源(这里以网易源为例)。

?

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 $ tee /etc/yum.repos.d/ceph.repo <<- 'EOF' [Ceph] name=Ceph packages for $basearch baseurl=http: //mirrors.163.com/ceph/rpm-jewel/el7/$basearch enabled=1 gpgcheck=0 type=rpm-md gpgkey=https: //mirrors.163.com/ceph/keys/release.asc priority=1 jpg[Ceph-noarch] name=Ceph noarch packages baseurl=http: //mirrors.163.com/ceph/rpm-jewel/el7/noarch enabled=1 gpgcheck=0 type=rpm-md gpgkey=https: //mirrors.163.com/ceph/keys/release.asc priority=1 [ceph-source] name=Ceph source packages baseurl=http: //mirrors.163.com/ceph/rpm-jewel/el7/SRPMS enabled=1 gpgcheck=0 type=rpm-md gpgkey=https: //mirrors.163.com/ceph/keys/release.asc priority=1 EOF

安装依赖

?

1 $ yum install -y yum-utils && yum-config-manager --add-repo https: //dl.fedoraproject.org/pub/epel/7/x86_64/ && yum install --nogpgcheck -y epel-release && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 && rm -f /etc/yum.repos.d/dl.fedoraproject.org* 

 

这一步非常重要,如果跳过这一步,直接进行ceph的安装,那么会报如下的错误:

?

1 2 3 4 5 6 7 8 9 10 Error: Package: 1:ceph-common-10.2.10-0.el7.x86_64 (Ceph)        Requires: libbabeltrace.so.1()(64bit) Error: Package: 1:librados2-10.2.10-0.el7.x86_64 (Ceph)        Requires: liblttng-ust.so.0()(64bit) Error: Package: 1:librgw2-10.2.10-0.el7.x86_64 (Ceph)        Requires: libfcgi.so.0()(64bit) Error: Package: 1:librbd1-10.2.10-0.el7.x86_64 (Ceph)        Requires: liblttng-ust.so.0()(64bit) Error: Package: 1:ceph-common-10.2.10-0.el7.x86_64 (Ceph)        Requires: libbabeltrace-ctf.so.1()(64bit)

安装Ceph

最后一步,安装Ceph,这里以安装Ceph-common为例:

?

1 $ yum -y install ceph-common

验证Ceph

?

1 2 $ ceph --version ceph version 10.2.10 (5dc1e4c05cb68dbf62ae6fce3f0700e4654fdbbe)

 

未经允许不得转载:搬瓦工中文网 » CentOS 7.0 安装 Ceph Jewel 及更高版本详细教程与实例解析