首先要确定是否安装automake autoconfig libtool(可以使用yum安装)

使用rpm -q boost-devel 查看是否安装boost-devel,如果未安装,使用yum安装,


svn checkout http://code.taobao.org/svn/tair/trunk/ tair

下载tair的源代码

在tbsys和tbnet都安装完毕后

进入 tair 目录

    运行 bootstrap.sh

    运行 configure.  注意, 在运行configue的时候, 可以使用 --with-boost=xxxx 来指定boost的目录. 使用--with-release=yes 来编译release版本.

注意:编译时需要使用到gcc gcc-c++ 因此在运行configure前,需要安装这两个。

    运行 make 进行编译

在make编译的时候,会出现如下问题:

In file included from stat_helper.cpp:17:

stat_helper.hpp:20:18: error: zlib.h: No such file or directory

stat_helper.cpp: In member function ‘void tair::stat_helper::do_compress()’:

stat_helper.cpp:148: error: ‘compressBound’ was not declared in this scope

stat_helper.cpp:157: error: ‘compress’ was not declared in this scope

stat_helper.cpp:158: error: ‘Z_OK’ was not declared in this scope

make[2]: *** [stat_helper.o] Error 1

make[2]: Leaving directory `/usr/local/src/tair/src/common'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/usr/local/src/tair/src'

make: *** [all-recursive] Error 1

这个时候,安装一下zlib-devel即可

yum install zlib-devel

    运行 make install 进行安装


[注意]每台tair(包括configserver和dataserver)配置文件只需要更改log dir、file dir、IP,每台tair的configserver.conf和group.conf必须一致,configserver.conf和dataserver.conf的dir要一致。