前面一段时间公司要求找一个分布式软件,于是就看了下开源的ceph,在官网上http:///download/下载了ceph-0.52.tar.gz源码包。
这儿记录了下自己安装的过程:
操作系统使用的是: CentOS-6.3-x86_64;
一、先安装一些编译常用工具,也是本次编译所需要用到的工具:
- <span style="font-size:14px;"><span style="white-space:pre"> </span>yum install automake autoconf automake libtool make</span>
二、然后就开始编译ceph源码了,解压ceph-0.52.tar.gz,并进入到源码目录下:
- <span style="font-size:14px;"><span style="white-space:pre"> </span>#tar -xzf ceph-0.52.tar.gz
- <span style="white-space:pre"> </span>#cd ceph-0.5.2
- <span style="white-space:pre"> </span>#./autogen.sh
- <span style="white-space:pre"> </span>#./configure</span>
执行./configure时会报一些错误:
- <span style="font-size:14px;"><span style="white-space:pre"> </span>configure: error: libuuid not found
- <span style="white-space:pre"> </span>configure: error: no FUSE found (use --without-fuse to disable)
- <span style="white-space:pre"> </span>configure: error: No usable version of libedit found.
- <span style="white-space:pre"> </span>configure: error: libaio not found</span>
这是因为缺少一些依赖包,安装所需要的依赖包:
- <span style="font-size:14px;"><span style="white-space:pre"> </span>yum install libuuid-devel
- <span style="white-space:pre"> </span>yum install fuse-devel
- <span style="white-space:pre"> </span>yum install libedit-devel
- <span style="white-space:pre"> </span>yum install libaio-devel
- <span style="white-space:pre"> </span>yum install keyutils-libs-devel
- <span style="white-space:pre"> </span>yum install gcc-c++
- <span style="white-space:pre"> </span>yum install cryptopp-devel</span>
成功安装好以上依赖包后在执行命令:
- <span style="font-size:14px;"><span style="white-space:pre"> </span>#./configure --without-tcmalloc --without-libatomic-ops</span>
运行这个命令的时候又遇到问题,还是的继续解决:- <span style="font-size:14px;"><span style="white-space:pre"> </span>checking boost/spirit.hpp usability... </span>
- <span style="font-size:14px;"><span style="white-space:pre"> </span>nochecking boost/spirit.hpp presence... </span>
- <span style="font-size:14px;"><span style="white-space:pre"> </span>nochecking for boost/spirit.hpp... </span>
- <span style="font-size:14px;"><span style="white-space:pre"> </span>noconfigure: error: in `/home/ceph-0.29':</span>
- <span style="font-size:14px;"><span style="white-space:pre"> </span>configure: error: "Can't find boost spirit headers"See `config.log' for more details</span>
这是缺少boost,我通过yum安装boost后没有解决,于是我下载boost源码包boost_1_46_0.tar.gz,解压后进行编译:
- <span style="white-space:pre"> </span># ./bootstrap.sh //脚本,生成 bjam可执行程序,然后再执行下面的配置,就编译完成了。
-
- <span style="white-space:pre"> </span>#./bjam --with-date_time --with-system --with-regex --with-thread --with-filesystem --with-serialization --with-iostreams --with-math --with-mpi --with-program_options --with-python --with-math --with-signals --layout=tagged install variant=debug,release link=static --runtime-link=static threading=multi stage
以上完成后,再执行命令:
- <span style="white-space:pre"> </span>./configure --without-tcmalloc --without-libatomic-ops
成功通过。现在就进行编译:
- <span style="white-space:pre"> </span>#make
哈哈,“前途是光明的,道路是曲折的”,又遇到了不想遇到的问题:
- <span style="white-space:pre"> </span>error: expat.h: No such file or directory
- <span style="white-space:pre"> </span>error: ‘XML_Parser’ does not name a type
一看就知道肯定是缺少某个包:
- <span style="white-space:pre"> </span>yum install expat-deve
安装好后再编译:
- <span style="white-space:pre"> </span>#make
- <span style="white-space:pre"> </span>#make install
到此,安装成功!!!!
当然,你可以通过官网上的安装方法安装:
http:///docs/master/install/rpm/
|