TFS編譯安裝

   本文記錄了tfs 2.2.16版本在centos linux 6.3 64位系統上的編譯安裝過程。Tfs編譯安裝官方推薦使用gcc 4.1.2, centos6.3系統自帶的gcc版本爲4.4.6,於是在make過程當中會報錯,主要緣由是gcc 4.4.6版本的編譯器對語法檢查嚴格致使的。目前tfs版本最新源碼爲2.6.62.6版本的編譯安裝須要tair支持,支持重複文件的去重。目前淘寶推薦開源用戶採用2.2.16版本。mysql


一:安裝基本的類庫linux

# yum -y install libuuid-devel zlib-devel mysql-devel
# cd /usr/local/src/
# svn checkout -r 18 http://code.taobao.org/svn/tb-common-utils/trunk/ tb-common-utils 
# export TBLIB_ROOT=/usr/local/lib/
# cd  tb-common-utils
# sh build.sh 
 
# wget
http://download.savannah.gnu.org/releases/libunwind/libunwind-0.99.tar.gz
# tar -zxvpf libunwind-0.99.tar.gz
# cd libunwind-0.99
# ./configure && make && make install
 
# wget https://gperftools.googlecode.com/files/google-perftools-1.7.tar.gz
# tar -zxvpf google-perftools-1.7.tar.gz 
# cd google-perftools-1.7
# ./configure && make && make install

二:編譯安裝tfssql

# cd /usr/local/src/
# svn co http://code.taobao.org/svn/tfs/tags/release-2.2.16
# cd release-2.2.16/
# ./build.sh init
# ./configure --prefix=/usr/local/tfs --with-release=yes
# make
# make install
# ls /usr/local/tfs/
bin  conf  include  lib  logs  scripts  sql

三:make常見報錯處理centos

##############################################################################
make報錯:
session_util.h:30: error: ISO C++ forbids declaration of ‘int32_t’ with no type
 
# vi ./src/common/session_util.h
第一行添加以下:
 #include <stdint.h>
 
##############################################################################
make報錯:
/usr/bin/ld: cannot find -ljemalloc
collect2: ld returned 1 exit status
make[2]: *** [dataserver] Error 1
 
# wget 
ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/abustany:/epel-rebuilds/CentOS_CentOS-6/x86_64/jemalloc-3.4.0-1.1.x86_64.rpm
 
# wget 
ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/abustany:/epel-rebuilds/CentOS_CentOS-6/x86_64/jemalloc-devel-3.4.0-1.1.x86_64.rpm
 
# rpm -ivh jemalloc-*
 
##############################################################################
make報錯:
meta_server_service.cpp:1584: error: invalid conversion from ‘const char*’ to ‘char*’
 
# vi ./src/name_meta_server/meta_server_service.cpp
1584行修改以下:
char* pos = (char *) strstr(sub_dir, parents_dir);
##############################################################################
相關文章
相關標籤/搜索