yum install python python-devel
一、安装libevent
http://www.monkey.org/~provos/libevent/
解压缩安装
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar zxvf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure
make
make install
二、安装boost
http://www.boost.org
(版本>=1.36) boost_1_45_0.tar.bz2
解压
wget http://jaist.dl.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.gz
tar zxvf boost_1_55_0.tar.gz
cd boost_1_55_0
./bootstrap.sh
./bjam -s HAVE_ICU=1 --prefix=/usr/local/boost --includedir=/usr/local/boost/include --libdir=/usr/local/boost/lib
./bjam install --prefix=/usr/local/boost
添加环境变量
export BOOST_ROOT=/usr/local/boost
export LD_LIBRARY_PATH=/usr/local/boost/lib:/usr/local/lib/:/usr/lib/
三、安装thrift
1.安装php环境
1)必须先安装 libxml2 ,然后在安装 php,
下载:ftp://xmlsoft.org/libxml2/ ,下载libxml2-2.7.8.tar.gz
tar -xvf libxml2-2.7.8.tar.gz
./configure
make
make install
2)下载 php: http://cn.php.net/downloads.php ,下载php-5.3.6.tar.gz
tar -vxf php-5.3.6.tar.gz
./configure --prefix=/usr/local/php5 --with-php-config=/usr/local/php5/bin/php-config
make
make install
(因为在 scribe 的一些版本中用到 php-config ,所以这里面要用 —with-php-config ,但是在我的安装过程没有用到,所以这个可以忽略)
2.安装thrift
http://incubator.apache.org/thrift/
(版本>=0.5.0)
1)先安装thrift,
解压并进入thrift目录
./configure --prefix=/usr/local/thrift --with-boost=/usr/local/boost --with-php-config=/usr/local/php5/bin/php-config
make
make install
验证
$ thrift -version
Thrift version 0.5.0
四、安装fb303
如果不需要,可以省略该步骤
Facebook Bassline (included in thrift/contrib/fb303/)
fb303 r697294 or later is required.
(已经包含在Thrift中了,重新编译一下fb303就可以)
cd ./contrib/fb303/
./bootstrap.sh --with-boost=/usr/local/boost
./configure --with-boost=/usr/local/boost --with-thriftpath=/usr/local/thrift
make
make install
安装完Thirft后,记得运行一下它提供的example,看是否安装成功。
验证:
cd ./thrift-0.5.0/tutorial
thrift -r -gen cpp tutorial.thrift // -r对其中include的文件也生成服务代码 -gen是生成服务代码的语言
cd cpp
make
运行完之后会在当前目录看到一个gen-cpp目录,其中就是thrfit命令生成的代码。这时你cd到tutorial/cpp目录,运行make,生成相应的CppServer与CppClient程式。
此时你可以分别运行CppServer和CppClient,让它们通信。
分享到:
相关推荐
thrift-0.5.0.tar.gz linux版本,不太好找了,大家用用吧。 尤其是1.0以上版本还有不兼容的情况。
thrift文件生成工具thrift-0.9.1.exe和thrift-0.9.2.exe压缩包
maven-thrift-plugin-0.1.11-sources.jar
thrift-0.13.0在Windows上exe程序;thrift-0.13.0在Windows上exe程序;thrift-0.13.0在Windows上exe程序
maven-thrift-plugin-0.1.11.jar
thrift开发时,将thrift文件自动生成java文件需要用到thrift-0.9.0.exe
thrift开发时,将thrift文件自动生成java文件需要用到thrift-0.9.0.exe
thrift-0.11.0.tar.gz
thrift开发时,将thrift文件自动生成java文件需要用到thrift-0.9.3.exe
thrift-0.9.1.exe和thrift-0.9.2.exe 含使用说明
thrift-0.9.2.安装.
thrift,Apache Thrift - 可伸缩的跨语言服务开发框架
thrift-0.9.0.tar.gz 类似google protocol buffer的东东的源代码
ice-dubbo-thrift-grpc性能测试对比 ,ice-dubbo-thrift-grpc性能测试对比,ice-dubbo-thrift-grpc性能测试对比,ice-dubbo-thrift-grpc性能测试对比
thrift-0.13.0 已编译的Java版本 包含thrift和其依赖包 thrift-0.13.0 已编译的Java版本 包含thrift和其依赖包
thrift-generator 是通过 Java 的接口生成 thrift 文件的工具。例子:public interface ICommonUserService { public User login(int id, String name); public User getUserById(long id); ...
thrift 0.9.3 for vs2013/vs2015 直接打开 thrift-master-0.9.3\lib\cppVS2013\thrift.sln thrift-master-0.9.3\lib\cppVS2015\thrift.sln 编译即可
流行RPC框架之Thrift安装工具(windows安装版),版本0.11.0
thrift-编译工具