概述
我们在使用ceph的时候经常有下面的需求:
- 遇到bug了,社区解决了,需要做fix bug的代码合入
- 自己需要对ceph源码做一些小改动
这些都需要修改原生ceph代码,然后编译之后再去测试。这里我们的目标就是把修改之后的ceph源码制作成rpm包,然后可以根据这些rpm到其他新机器上去安装、部署ceph集群,最后测试我们的改动点。
1、准备编译机
首先准备一台编译机,最好是物理机,虚拟机太慢了。下面是我准备的编译机系统环境:
[root@node114 ~]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
[root@node114 ~]# uname -a
Linux node114 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
2、获取指定版本的ceph源码包
下载对应的ceph源码包(下载地址:http://mirrors.aliyun.com/ceph/rpm-jewel/el7/SRPMS/),我这里下载的ceph10.2.7。
创建编译目录,这个目录可以根据你自己的实际情况来
[root@node114 ~]# mkdir -p /root/dp/ceph10.2.7
[root@node114 ~]# cd /root/dp/ceph10.2.7
将下载好的ceph源码包ceph-10.2.7-0.el7.src.rpm放到/root/dp/ceph10.2.7目录里面,并解压
[root@node114 ceph10.2.7]# rpm2cpio ceph-10.2.7-0.el7.src.rpm |cpio -div
[root@node114 ceph10.2.7]# tar -xvf ceph-10.2.7.tar.bz2
查看下当前目录应该有以下几个文件
[root@node114 ceph10.2.7]# ll
total 3927556
drwxr-xr-x 13 1108 1108 4096 Aug 28 09:32 ceph-10.2.7
-rw-r--r-- 1 root root 11245006 Apr 11 2017 ceph-10.2.7-0.el7.src.rpm
-rw-r--r-- 1 root root 11251231 Aug 28 09:31 ceph-10.2.7.tar.bz2
-rw-r--r-- 1 root root 47629 Aug 28 09:31 ceph.spec
3、编译ceph源码
3.1 cd到源码目录里面
[root@node114 ceph10.2.7]# cd ceph-10.2.7
3.2 安装相关依赖包
[root@node114 ceph-10.2.7]# ./install-deps.sh
3.3 生成configure文件
[root@node114 ceph-10.2.7]# ./autogen.sh
3.4 生成makefile文件
[root@node114 ceph-10.2.7]# ./configure
3.5 开始编译
[root@node114 ceph-10.2.7]# make -j8
好了,上面可以正常编译ceph源码。此时,如果我们对ceph源码做了一些更改,比如修改了一个bug或增加了一个功能,想给到测试人员去测试,那我们可以制作成rpm包,然后再给到测试人员去其他新机器上安装部署集群。下面就开始制作rpm包。
4、制作rpm包
此时,随便修改点ceph源码,比如加几个日志输出,然后将我们上面修改好的ceph源码制作成对应的rpm包。
4.1 安装配置rpmbuild
我们需要只用rpmbuild工具制作rpm包,所以这里需要安装这个工具,如果你的环境上已经安装,则可以跳过
[root@node114 ceph10.2.7]# yum install rpm-build rpmdevtools
创建rpmbuild需要的一些目录
[root@node114 ceph10.2.7]# mkdir -p /root/dp/rpmbuild/{SOURCES,BUILDROOT,RPMS,SPECS,SRPMS}/
4.2 打包我们修改之后的ceph源码
将我们修改之后的ceph源码打包
[root@node114 ceph10.2.7]# tar -cvf /root/dp/rpmbuild/SOURCES/ceph-10.2.7.tar.bz2 ceph-10.2.7
将ceph.spec文件放到/root/dp/SPECS目录下
[root@node114 ceph10.2.7]# cp ceph.spec /root/dp/rpmbuild/SPECS
开始制作rpm包
[root@node114 ceph10.2.7]# cd ~
[root@node114 ~]# rpmbuild -bb --define '_topdir /root/dp/rpmbuild' /root/dp/rpmbuild/SPECS/ceph.spec
如果上面rpmbuild这一步报依赖包错误,则根据报错信息,使用yum安装对应的包即可,因为环境不同可能报的依赖包错误可能不一样,以下是我的环境需要安装的依赖包
[root@node114 ~]# yum install -y checkpolicy selinux-policy-devel cmake hdparm libxml2-devel python-nose python-sphinx
[root@node114 ~]# yum install -y valgrind-devel xmlstarlet yasm nss-devel lttng-ust-devel libbabeltrace-devel junit policyhelp
[root@node114 ~]# yum install selinux-policy-doc -y
好了,安装好依赖包之后,再次执行rpmbuild -bb命令进行rpm包制作,接下来就等待rpm包制作完成。
4.3 查看制作好的rpm包
上面执行完rpmbuild命令之后,如果没有错误发生,那么就可以在/root/dp/rpmbuild/RPMS/目录下看到制作好的rpm包了
[root@node114 ~]# tree dp/rpmbuild/RPMS/
dp/rpmbuild/RPMS/
└── x86_64
├── ceph-10.2.7-0.el7.centos.x86_64.rpm
├── ceph-base-10.2.7-0.el7.centos.x86_64.rpm
├── ceph-common-10.2.7-0.el7.centos.x86_64.rpm
├── ceph-debuginfo-10.2.7-0.el7.centos.x86_64.rpm
├── ceph-devel-compat-10.2.7-0.el7.centos.x86_64.rpm
├── cephfs-java-10.2.7-0.el7.centos.x86_64.rpm
├── ceph-fuse-10.2.7-0.el7.centos.x86_64.rpm
├── ceph-libs-compat-10.2.7-0.el7.centos.x86_64.rpm
├── ceph-mds-10.2.7-0.el7.centos.x86_64.rpm
├── ceph-mon-10.2.7-0.el7.centos.x86_64.rpm
├── ceph-osd-10.2.7-0.el7.centos.x86_64.rpm
├── ceph-radosgw-10.2.7-0.el7.centos.x86_64.rpm
├── ceph-selinux-10.2.7-0.el7.centos.x86_64.rpm
├── ceph-test-10.2.7-0.el7.centos.x86_64.rpm
├── libcephfs1-10.2.7-0.el7.centos.x86_64.rpm
├── libcephfs1-devel-10.2.7-0.el7.centos.x86_64.rpm
├── libcephfs_jni1-10.2.7-0.el7.centos.x86_64.rpm
├── libcephfs_jni1-devel-10.2.7-0.el7.centos.x86_64.rpm
├── librados2-10.2.7-0.el7.centos.x86_64.rpm
├── librados2-devel-10.2.7-0.el7.centos.x86_64.rpm
├── libradosstriper1-10.2.7-0.el7.centos.x86_64.rpm
├── libradosstriper1-devel-10.2.7-0.el7.centos.x86_64.rpm
├── librbd1-10.2.7-0.el7.centos.x86_64.rpm
├── librbd1-devel-10.2.7-0.el7.centos.x86_64.rpm
├── librgw2-10.2.7-0.el7.centos.x86_64.rpm
├── librgw2-devel-10.2.7-0.el7.centos.x86_64.rpm
├── python-ceph-compat-10.2.7-0.el7.centos.x86_64.rpm
├── python-cephfs-10.2.7-0.el7.centos.x86_64.rpm
├── python-rados-10.2.7-0.el7.centos.x86_64.rpm
├── python-rbd-10.2.7-0.el7.centos.x86_64.rpm
├── rbd-fuse-10.2.7-0.el7.centos.x86_64.rpm
├── rbd-mirror-10.2.7-0.el7.centos.x86_64.rpm
└── rbd-nbd-10.2.7-0.el7.centos.x86_64.rpm
1 directory, 33 files
ok,现在可以把这些rpm包放到其他机器上去安装、部署集群测试我们自己加的一些东西了。
5、通过rpm包安装集群
前面我们已经制作好了ceph的相关rpm包,现在我们需要在新机器上,通过这些rpm包来安装、部署ceph集群。
5.1 准备新机器
我们准备了一台全新的虚拟机,环境如下:
[root@lab02 ~]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
[root@lab02 ~]# uname -a
Linux lab02 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
然后将我们制作好的ceph rpm包放到新机器上
[root@lab02 cephrpms]# pwd
/root/cephrpms
[root@lab02 cephrpms]# ll
total 1414128
-rw-r--r--. 1 root root 1888 Sep 21 16:39 ceph-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 4384184 Sep 21 16:39 ceph-base-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 17300368 Sep 21 16:39 ceph-common-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 1316040884 Sep 21 16:39 ceph-debuginfo-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 2124 Sep 21 16:40 ceph-devel-compat-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 22208 Sep 21 16:40 cephfs-java-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 1935520 Sep 21 16:40 ceph-fuse-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 2076 Sep 21 16:40 ceph-libs-compat-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 2921008 Sep 21 16:40 ceph-mds-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 2922192 Sep 21 16:40 ceph-mon-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 9458688 Sep 21 16:40 ceph-osd-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 271052 Sep 21 16:40 ceph-radosgw-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 19516 Sep 21 16:40 ceph-selinux-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 76149364 Sep 21 16:40 ceph-test-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 1940680 Sep 21 16:40 libcephfs1-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 12912 Sep 21 16:40 libcephfs1-devel-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 1641100 Sep 21 16:40 libcephfs_jni1-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 2392 Sep 21 16:40 libcephfs_jni1-devel-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 1985928 Sep 21 16:40 librados2-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 486748 Sep 21 16:40 librados2-devel-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 1905556 Sep 21 16:40 libradosstriper1-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 7828 Sep 21 16:40 libradosstriper1-devel-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 2617624 Sep 21 16:40 librbd1-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 12428 Sep 21 16:40 librbd1-devel-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 3058764 Sep 21 16:40 librgw2-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 5052 Sep 21 16:40 librgw2-devel-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 2000 Sep 21 16:40 python-ceph-compat-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 78740 Sep 21 16:40 python-cephfs-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 147992 Sep 21 16:40 python-rados-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 79348 Sep 21 16:40 python-rbd-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 442080 Sep 21 16:40 rbd-fuse-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 1652712 Sep 21 16:40 rbd-mirror-10.2.7-0.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root 482776 Sep 21 16:40 rbd-nbd-10.2.7-0.el7.centos.x86_64.rpm
5.2 安装ceph的依赖
因为我们只是制作了ceph相关的rpm包,ceph本身需要依赖其他第三方的一些软件,所以我们需要安装那些依赖,那到底需要哪些依赖包呢?我们来让系统提示我们
[root@lab02 cephrpms]# rpm -ivh *.rpm
error: Failed dependencies:
cryptsetup is needed by ceph-base-1:10.2.7-0.el7.centos.x86_64
hdparm is needed by ceph-base-1:10.2.7-0.el7.centos.x86_64
libboost_iostreams-mt.so.1.53.0()(64bit) is needed by ceph-base-1:10.2.7-0.el7.centos.x86_64
libboost_random-mt.so.1.53.0()(64bit) is needed by ceph-base-1:10.2.7-0.el7.centos.x86_64
liblttng-ust.so.0()(64bit) is needed by ceph-base-1:10.2.7-0.el7.centos.x86_64
python-requests is needed by ceph-base-1:10.2.7-0.el7.centos.x86_64
python-setuptools is needed by ceph-base-1:10.2.7-0.el7.centos.x86_64
libbabeltrace-ctf.so.1()(64bit) is needed by ceph-common-1:10.2.7-0.el7.centos.x86_64
libbabeltrace.so.1()(64bit) is needed by ceph-common-1:10.2.7-0.el7.centos.x86_64
libboost_iostreams-mt.so.1.53.0()(64bit) is needed by ceph-common-1:10.2.7-0.el7.centos.x86_64
libboost_program_options-mt.so.1.53.0()(64bit) is needed by ceph-common-1:10.2.7-0.el7.centos.x86_64
libboost_regex-mt.so.1.53.0()(64bit) is needed by ceph-common-1:10.2.7-0.el7.centos.x86_64
libtcmalloc.so.4()(64bit) is needed by ceph-common-1:10.2.7-0.el7.centos.x86_64
python-requests is needed by ceph-common-1:10.2.7-0.el7.centos.x86_64
java is needed by cephfs-java-1:10.2.7-0.el7.centos.x86_64
junit is needed by cephfs-java-1:10.2.7-0.el7.centos.x86_64
libboost_iostreams-mt.so.1.53.0()(64bit) is needed by ceph-fuse-1:10.2.7-0.el7.centos.x86_64
libfuse.so.2()(64bit) is needed by ceph-fuse-1:10.2.7-0.el7.centos.x86_64
libfuse.so.2(FUSE_2.4)(64bit) is needed by ceph-fuse-1:10.2.7-0.el7.centos.x86_64
libfuse.so.2(FUSE_2.5)(64bit) is needed by ceph-fuse-1:10.2.7-0.el7.centos.x86_64
libfuse.so.2(FUSE_2.6)(64bit) is needed by ceph-fuse-1:10.2.7-0.el7.centos.x86_64
libfuse.so.2(FUSE_2.8)(64bit) is needed by ceph-fuse-1:10.2.7-0.el7.centos.x86_64
libfuse.so.2(FUSE_2.9)(64bit) is needed by ceph-fuse-1:10.2.7-0.el7.centos.x86_64
libtcmalloc.so.4()(64bit) is needed by ceph-fuse-1:10.2.7-0.el7.centos.x86_64
libboost_iostreams-mt.so.1.53.0()(64bit) is needed by ceph-mds-1:10.2.7-0.el7.centos.x86_64
libtcmalloc.so.4()(64bit) is needed by ceph-mds-1:10.2.7-0.el7.centos.x86_64
libboost_iostreams-mt.so.1.53.0()(64bit) is needed by ceph-mon-1:10.2.7-0.el7.centos.x86_64
libboost_random-mt.so.1.53.0()(64bit) is needed by ceph-mon-1:10.2.7-0.el7.centos.x86_64
libleveldb.so.1()(64bit) is needed by ceph-mon-1:10.2.7-0.el7.centos.x86_64
libtcmalloc.so.4()(64bit) is needed by ceph-mon-1:10.2.7-0.el7.centos.x86_64
python-flask is needed by ceph-mon-1:10.2.7-0.el7.centos.x86_64
gdisk is needed by ceph-osd-1:10.2.7-0.el7.centos.x86_64
libboost_iostreams-mt.so.1.53.0()(64bit) is needed by ceph-osd-1:10.2.7-0.el7.centos.x86_64
libboost_program_options-mt.so.1.53.0()(64bit) is needed by ceph-osd-1:10.2.7-0.el7.centos.x86_64
libboost_random-mt.so.1.53.0()(64bit) is needed by ceph-osd-1:10.2.7-0.el7.centos.x86_64
libfuse.so.2()(64bit) is needed by ceph-osd-1:10.2.7-0.el7.centos.x86_64
libfuse.so.2(FUSE_2.2)(64bit) is needed by ceph-osd-1:10.2.7-0.el7.centos.x86_64
libfuse.so.2(FUSE_2.5)(64bit) is needed by ceph-osd-1:10.2.7-0.el7.centos.x86_64
libfuse.so.2(FUSE_2.6)(64bit) is needed by ceph-osd-1:10.2.7-0.el7.centos.x86_64
libfuse.so.2(FUSE_2.8)(64bit) is needed by ceph-osd-1:10.2.7-0.el7.centos.x86_64
libleveldb.so.1()(64bit) is needed by ceph-osd-1:10.2.7-0.el7.centos.x86_64
libtcmalloc.so.4()(64bit) is needed by ceph-osd-1:10.2.7-0.el7.centos.x86_64
libfcgi.so.0()(64bit) is needed by ceph-radosgw-1:10.2.7-0.el7.centos.x86_64
mailcap is needed by ceph-radosgw-1:10.2.7-0.el7.centos.x86_64
python-flask is needed by ceph-radosgw-1:10.2.7-0.el7.centos.x86_64
selinux-policy-base >= 3.13.1-192.el7_5.6 is needed by ceph-selinux-1:10.2.7-0.el7.centos.x86_64
libboost_iostreams-mt.so.1.53.0()(64bit) is needed by ceph-test-1:10.2.7-0.el7.centos.x86_64
libboost_program_options-mt.so.1.53.0()(64bit) is needed by ceph-test-1:10.2.7-0.el7.centos.x86_64
libboost_random-mt.so.1.53.0()(64bit) is needed by ceph-test-1:10.2.7-0.el7.centos.x86_64
libleveldb.so.1()(64bit) is needed by ceph-test-1:10.2.7-0.el7.centos.x86_64
libtcmalloc.so.4()(64bit) is needed by ceph-test-1:10.2.7-0.el7.centos.x86_64
xmlstarlet is needed by ceph-test-1:10.2.7-0.el7.centos.x86_64
libboost_iostreams-mt.so.1.53.0()(64bit) is needed by libcephfs1-1:10.2.7-0.el7.centos.x86_64
libboost_random-mt.so.1.53.0()(64bit) is needed by libcephfs1-1:10.2.7-0.el7.centos.x86_64
java is needed by libcephfs_jni1-1:10.2.7-0.el7.centos.x86_64
libboost_iostreams-mt.so.1.53.0()(64bit) is needed by libcephfs_jni1-1:10.2.7-0.el7.centos.x86_64
libboost_random-mt.so.1.53.0()(64bit) is needed by libcephfs_jni1-1:10.2.7-0.el7.centos.x86_64
java is needed by libcephfs_jni1-devel-1:10.2.7-0.el7.centos.x86_64
libboost_iostreams-mt.so.1.53.0()(64bit) is needed by librados2-1:10.2.7-0.el7.centos.x86_64
libboost_random-mt.so.1.53.0()(64bit) is needed by librados2-1:10.2.7-0.el7.centos.x86_64
liblttng-ust.so.0()(64bit) is needed by librados2-1:10.2.7-0.el7.centos.x86_64
libboost_iostreams-mt.so.1.53.0()(64bit) is needed by librados2-devel-1:10.2.7-0.el7.centos.x86_64
libboost_iostreams-mt.so.1.53.0()(64bit) is needed by libradosstriper1-1:10.2.7-0.el7.centos.x86_64
libboost_random-mt.so.1.53.0()(64bit) is needed by libradosstriper1-1:10.2.7-0.el7.centos.x86_64
libboost_iostreams-mt.so.1.53.0()(64bit) is needed by librbd1-1:10.2.7-0.el7.centos.x86_64
libboost_random-mt.so.1.53.0()(64bit) is needed by librbd1-1:10.2.7-0.el7.centos.x86_64
liblttng-ust.so.0()(64bit) is needed by librbd1-1:10.2.7-0.el7.centos.x86_64
libboost_iostreams-mt.so.1.53.0()(64bit) is needed by librgw2-1:10.2.7-0.el7.centos.x86_64
libboost_random-mt.so.1.53.0()(64bit) is needed by librgw2-1:10.2.7-0.el7.centos.x86_64
libfcgi.so.0()(64bit) is needed by librgw2-1:10.2.7-0.el7.centos.x86_64
libboost_iostreams-mt.so.1.53.0()(64bit) is needed by rbd-fuse-1:10.2.7-0.el7.centos.x86_64
libfuse.so.2()(64bit) is needed by rbd-fuse-1:10.2.7-0.el7.centos.x86_64
libfuse.so.2(FUSE_2.5)(64bit) is needed by rbd-fuse-1:10.2.7-0.el7.centos.x86_64
libfuse.so.2(FUSE_2.6)(64bit) is needed by rbd-fuse-1:10.2.7-0.el7.centos.x86_64
libboost_iostreams-mt.so.1.53.0()(64bit) is needed by rbd-mirror-1:10.2.7-0.el7.centos.x86_64
libboost_random-mt.so.1.53.0()(64bit) is needed by rbd-mirror-1:10.2.7-0.el7.centos.x86_64
libboost_iostreams-mt.so.1.53.0()(64bit) is needed by rbd-nbd-1:10.2.7-0.el7.centos.x86_64
libboost_regex-mt.so.1.53.0()(64bit) is needed by rbd-nbd-1:10.2.7-0.el7.centos.x86_64
哇··· 这么多依赖,ceph本身就是个庞大复杂的东西,依赖多也正常。我们通过yum的方式来处理这些依赖
[root@lab02 cephrpms]# yum install -y cryptsetup hdparm boost python-requests python-setuptools fuse fuse-devel leveldb fcgi gperftools-libs java babeltrace libbabeltrace libbabeltrace-devel junit python-flask gdisk mailcap selinux-policy-base xmlstarlet lttng-ust lttng-ust-devel
5.3 安装ceph
好了,我们开始来安装ceph了
[root@lab02 cephrpms]# rpm -ivh *.rpm
Preparing... ################################# [100%]
Updating / installing...
1:librados2-1:10.2.7-0.el7.centos ################################# [ 3%]
2:librbd1-1:10.2.7-0.el7.centos ################################# [ 6%]
3:libcephfs1-1:10.2.7-0.el7.centos ################################# [ 9%]
4:librgw2-1:10.2.7-0.el7.centos ################################# [ 12%]
5:librados2-devel-1:10.2.7-0.el7.ce################################# [ 15%]
6:python-rados-1:10.2.7-0.el7.cento################################# [ 18%]
7:libradosstriper1-1:10.2.7-0.el7.c################################# [ 21%]
8:python-cephfs-1:10.2.7-0.el7.cent################################# [ 24%]
9:python-rbd-1:10.2.7-0.el7.centos ################################# [ 27%]
10:ceph-common-1:10.2.7-0.el7.centos################################# [ 30%]
11:ceph-selinux-1:10.2.7-0.el7.cento################################# [ 33%]
12:ceph-base-1:10.2.7-0.el7.centos ################################# [ 36%]
13:libcephfs_jni1-1:10.2.7-0.el7.cen################################# [ 39%]
14:libcephfs_jni1-devel-1:10.2.7-0.e################################# [ 42%]
15:ceph-mds-1:10.2.7-0.el7.centos ################################# [ 45%]
16:ceph-mon-1:10.2.7-0.el7.centos ################################# [ 48%]
17:ceph-osd-1:10.2.7-0.el7.centos ################################# [ 52%]
18:libradosstriper1-devel-1:10.2.7-0################################# [ 55%]
19:libcephfs1-devel-1:10.2.7-0.el7.c################################# [ 58%]
20:librbd1-devel-1:10.2.7-0.el7.cent################################# [ 61%]
21:ceph-devel-compat-1:10.2.7-0.el7.################################# [ 64%]
22:ceph-1:10.2.7-0.el7.centos ################################# [ 67%]
23:cephfs-java-1:10.2.7-0.el7.centos################################# [ 70%]
24:ceph-radosgw-1:10.2.7-0.el7.cento################################# [ 73%]
25:ceph-test-1:10.2.7-0.el7.centos ################################# [ 76%]
26:rbd-mirror-1:10.2.7-0.el7.centos ################################# [ 79%]
27:python-ceph-compat-1:10.2.7-0.el7################################# [ 82%]
28:librgw2-devel-1:10.2.7-0.el7.cent################################# [ 85%]
29:ceph-libs-compat-1:10.2.7-0.el7.c################################# [ 88%]
30:rbd-fuse-1:10.2.7-0.el7.centos ################################# [ 91%]
31:rbd-nbd-1:10.2.7-0.el7.centos ################################# [ 94%]
32:ceph-fuse-1:10.2.7-0.el7.centos ################################# [ 97%]
33:ceph-debuginfo-1:10.2.7-0.el7.cen################################# [100%]
检查下是否都已经正确安装
[root@lab02 cephrpms]# rpm -qa|grep ceph
libcephfs_jni1-10.2.7-0.el7.centos.x86_64
ceph-osd-10.2.7-0.el7.centos.x86_64
ceph-devel-compat-10.2.7-0.el7.centos.x86_64
ceph-test-10.2.7-0.el7.centos.x86_64
ceph-libs-compat-10.2.7-0.el7.centos.x86_64
ceph-debuginfo-10.2.7-0.el7.centos.x86_64
python-cephfs-10.2.7-0.el7.centos.x86_64
ceph-common-10.2.7-0.el7.centos.x86_64
ceph-base-10.2.7-0.el7.centos.x86_64
libcephfs_jni1-devel-10.2.7-0.el7.centos.x86_64
ceph-mon-10.2.7-0.el7.centos.x86_64
ceph-10.2.7-0.el7.centos.x86_64
ceph-radosgw-10.2.7-0.el7.centos.x86_64
ceph-fuse-10.2.7-0.el7.centos.x86_64
libcephfs1-10.2.7-0.el7.centos.x86_64
ceph-selinux-10.2.7-0.el7.centos.x86_64
ceph-mds-10.2.7-0.el7.centos.x86_64
libcephfs1-devel-10.2.7-0.el7.centos.x86_64
cephfs-java-10.2.7-0.el7.centos.x86_64
python-ceph-compat-10.2.7-0.el7.centos.x86_64
上面我们已经安装完ceph软件及其依赖的软件包了,就可以正常的部署集群了,部署的步骤不是这里的重点,就不再详细描述了。下面是我部署的集群:
[root@lab02 cephdeploy]# ceph -s
cluster f4235ef8-86bd-43bb-a794-e8cb0e74c68e
health HEALTH_OK
monmap e1: 1 mons at {lab02=192.168.10.60:6789/0}
election epoch 3, quorum 0 lab02
osdmap e10: 2 osds: 2 up, 2 in
flags sortbitwise,require_jewel_osds
pgmap v20: 64 pgs, 1 pools, 0 bytes data, 0 objects
68516 kB used, 30631 MB / 30697 MB avail
64 active+clean
总结
好了,我们这里就完成我们开始的目标,这里再总结下我们做了哪些事情:
- 获取ceph指定版本的源码,正确编译源码
- 修改一点ceph源码,比如可以在osd启动的时候加点输出(修改ceph_osd.cc)
- 编译修改之后的源码,制作rpm包
- 到新机器上通过rpm包方式安装集群,然后部署集群