install ceph 13.2.1 without internet

install ceph 13.2.1 without internet

Ceph的rpm包安装方式,需要使用yum,在内网环境中,往往没有internet连接。本文介绍一种不太用动脑的离线安装方法。

想偷懒需要具备两个条件:

l 有足够高带宽的上网条件

l 有足够的硬盘空间

因为,我们采用的无internet安装ceph的方法很简单,就是把internet上需要用到的yum源,整个下载下来,做成本地yum源就好了。这样的好处是不止安装ceph能用,测试其他开源软件时,也能用。

测试包依赖关系

首先用virtualbox装个centos虚拟机,一般和将来内网要部署的环境版本一致,用来测试需要包的依赖关系,我们这里用的是centos7.4。

我们以ceph mimic版本为例,按照ceph文档设置好yum源:

l Ceph yum 源

# more ceph.repo

[ceph]

name=Ceph packages for $basearch

baseurl=https://hk.ceph.com/rpm-mimic/el7/$basearch

enabled=1

priority=2

gpgcheck=1

gpgkey=https://hk.ceph.com/keys/release.asc

[ceph-noarch]

name=Ceph noarch packages

baseurl=https://hk.ceph.com/rpm-mimic/el7/noarch

enabled=1

priority=2

gpgcheck=1

gpgkey=https://hk.ceph.com/keys/release.asc

l 安装epel源

# rpm –ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm

l 查看源情况

clip_image002

l 尝试安装ceph,分析依赖的包

# yum install ceph

显然第一次就成功的可能性几乎没有,通过yum的输出信息,我们知道,centos 7.4安装 ceph 13.2.1,还需要将个别包升级到centos 7.5包含的版本,而且还需要进一步安装更新。只有一个包,不属于epel,也不属于centos,python-werkzeug-0.9.1-2.el7.noarch.rpm。

为了安装成功,还需要2个yum源:

1. Centos7.5的DVD

2. Centos updates

将DVD iso 做成yum源很简单,centos updates的yum源是这样的:

[centos-updates]

name=centos-updates

baseurl=http://mirror.centos.org/centos/7/updates/x86_64/

gpgcheck=0

enabled=1

至于python-werkzeug-0.9.1-2.el7.noarch.rpm,手动下载安装就可以,rpm包我们后续会做到yum源里面。

完成了这些工作,ceph就可以正常安装成功了。

通过这个过程,我们知道本地yum源要做4个:

1. Centos 7.5 DVD

2. Ceph

3. Epel

4. Centos updates + python-werkzeug-0.9.1-2.el7.noarch.rpm

下载及制作本地yum源

l 下载

在这台配置好了所有internet yum源的虚拟机,执行命令将yum下载(同步)到本地:

# reposync –r ceph –p /var/www/html/cephyumsource

# reposync –r ceph-noarch –p /var/www/html/cephyumsource

# reposync –r epel –p /var/www/html/epel

# reposync –r centos-updates –p /var/www/html/others

开几个窗口,做了这个,就可以睡了,100M宽带,一晚上肯定下完了。

Ceph很小,几百兆,epel是14G,centos-updates是4G,至于centos 7.5 的DVD,我又下了一个everything版本的iso文件,8G。

l 制作yum源

# createrepo /var/www/html/cephyumsource/ceph

# createrepo /var/www/html/cephyumsource/ceph-noarch

# createrepo /var/www/html/epel/epel

将python-werkzeug-0.9.1-2.el7.noarch.rpm复制到/var/www/html/others/centos-updates目录中

# createrepo /var/www/html/others/centos-updates

将centos 7.5 的iso文件挂载到vm上,然后mount

# mount /dev/sr0 /var/www/html/centos-iso

确保httpd是启动的。

内网安装

在要安装的内网机器上,设置内网yum源:

(上一步我们配置的虚拟机在内网的地址是192.168.1.5)

# more local-epel.repo

[local-epel]

name=local-epel

baseurl=http://192.168.1.5/epel/epel

gpgcheck=0

enabled=1

# more ceph-local.repo

[ceph-local]

name=Ceph packages for $basearch

baseurl=http://192.168.1.5/cephyumsource/ceph

enabled=1

priority=2

gpgcheck=0

[ceph-noarch-local]

name=Ceph noarch packages

baseurl=http://192.168.1.5/cephyumsource/ceph-noarch

enabled=1

priority=2

gpgcheck=0

# more centos-updates.repo

[others]

name=centos-updates-and-others

baseurl=http://192.168.1.5/others/centos-updates

gpgcheck=0

enabled=1

# more centos-iso.repo

[centos-iso]

name=centos-iso

baseurl=http://192.168.1.5/centos-iso

gpgcheck=0

enabled=1

安装ceph

# yum install ceph

# ceph –version

ceph version 13.2.1 (5533ecdc0fda920179d7ad84e0aa65a127b20d77) mimic (stable)

(如果在安装ceph时报selinux包依赖错误,可以先尝试将selinux相关包更新到7.5的版本,yum 源配置不用改,#yum update selinux-policy,再安装ceph。)

Comments are closed.