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版本。


一:安装基本的类库

# 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

二:编译安装tfs

# 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常见报错处理

##############################################################################
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);
##############################################################################


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值