hl10502的博客

CentOS7.2编译Jewel版ceph-10.2.7

在CentOS7.2下编译Jewel版ceph-10.2.7,通过解压ceph-10.2.7.tar.gz来编译ceph。

环境

CentOS Linux release 7.2.1511 (Core) Mini版

配置yum

使用网易的源CentOS-Base.repo,并配置epel.repo

安装依赖

下载依赖的rpm到本地

1
[root@node156 ~]# yum install --downloadonly --downloaddir=/tmp/ceph-10.2.7 make automake autoconf boost-devel fuse-devel gcc-c++ libtool libuuid-devel libblkid-devel keyutils-libs-devel cryptopp-devel fcgi-devel libcurl-devel expat-devel gperftools-devel libedit-devel libatomic_ops-devel snappy-devel leveldb-devel libaio-devel xfsprogs-devel libudev-devel btrfs-progs Cython python-devel openssl-devel openldap-devel python-pip python-virtualenv net-tools

本地安装依赖的rpm包

1
[root@node156 ~]# yum localinstall -C -y --disablerepo=* /tmp/ceph-10.2.7/*.rpm

编译安装

下载ceph源码tar.gz文件

下载地址:

https://download.ceph.com/tarballs/ceph-10.2.7.tar.gz

http://pkgs.fedoraproject.org/repo/pkgs/ceph/ceph-10.2.7.tar.gz

https://codeload.github.com/ceph/ceph/tar.gz/v10.2.7

解压

[root@node156 ~]# tar xzvf ceph-10.2.7.tar.gz

源码编译

1
2
3
[root@node156 ~]# cd ceph-10.2.7
[root@node156 ceph-10.2.7]# ./autogen.sh
[root@node156 ceph-10.2.7]# ./configure

中间会有一些warning,只要没有error就是成功了。

1
[root@node156 ceph-10.2.7]# make -j4

启动停止集群

进入src目录,启动集群,默认3个MON,3个OSD

1
2
[root@node156 ceph-10.2.7]# cd src
[root@node156 src]# ./vstart.sh -d -n -x

指定1个MON,0个MDS,启动集群

1
[root@node156 src]# MON=1 MDS=0 ./vstart.sh -d -n -x

查看集群

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[root@node156 src]# ./ceph -s
*** DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH ***
2017-07-13 04:24:35.083777 7f84942f8700 -1 WARNING: the following dangerous and experimental features are enabled: *
2017-07-13 04:24:35.087659 7f84942f8700 -1 WARNING: the following dangerous and experimental features are enabled: *
cluster 0e262580-8dbd-4ac4-ad98-c5966aa7c9ad
health HEALTH_OK
monmap e1: 3 mons at {a=127.0.0.1:6789/0,b=127.0.0.1:6790/0,c=127.0.0.1:6791/0}
election epoch 4, quorum 0,1,2 a,b,c
fsmap e6: 1/1/1 up {0=c=up:active}, 2 up:standby
osdmap e11: 3 osds: 3 up, 3 in
flags sortbitwise,require_jewel_osds
pgmap v25: 24 pgs, 3 pools, 2068 bytes data, 20 objects
60178 MB used, 88675 MB / 145 GB avail
24 active+clean

停止集群

1
[root@node156 src]# ./stop.sh

编译错误信息处理

安装 Cython

1
configure:17667: error: cython not found

安装 python-devel

1
configure:17667: error: python-config not found

安装 openssl-devel

1
configure:20311: error: radosgw selected but OpenSSL not found

安装 openldap-devel

1
configure: error: ldap.h not found (openldap-dev, openldap-devel)

安装 python-virtualenv

1
2
3
4
5
6
7
8
/bin/sh: /tmp/ceph-disk-virtualenv/bin/pip: No such file or directory
make[3]: *** [/tmp/ceph-disk-virtualenv] Error 127
make[3]: Leaving directory `/root/ceph-10.2.7/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/ceph-10.2.7/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/ceph-10.2.7/src'
make: *** [all-recursive] Error 1