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