关于thrift的介绍:http://www.ibm.com/developerworks/cn/java/j-lo-apachethrift/java
Apache Thrift 是 Facebook 实现的一种高效的、支持多种编程语言的远程服务调用的框架。它采用接口描述语言定义并建立服务,支持可扩展的跨语言服务开发,所包含的代码生成引擎能够在多种语言中,如 C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, Smalltalk 等建立高效的、无缝的服务,其传输数据采用二进制格式,相对 XML 和 JSON 体积更小,对于高并发、大数据量和多语言的环境更有优点。本文将详细介绍 Thrift 的使用,而且提供丰富的实例代码加以解释说明,帮助使用者快速构建服务。git
好了。身为一个死运维,开发提出需求让装一个这样开发框架,期间提示缺乏各类openssl的安装包的库文件依赖。随着安装成功现总结安装过程以下:github
安装软件准备:
thrift http://mirror.bit.edu.cn/apache/thrift/0.9.1/thrift-0.9.1.tar.gz
boost http://sourceforge.net/projects/boost/files/boost/1.54.0/boost_1_54_0.tar.gz/download
openssl http://www.openssl.org/source/openssl-1.0.1e.tar.gz
libevent https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
thrift安装路径为:/data/thrift/thrift
boost安装路径为:/data/thrift/boost
openssl安装路径为:/data/thrift/openssl
libevent安装路径为:/data/thrift/libevent
一、编译安装前须要下载openssl,libevent,thrift,boostweb
二、libevent的安装方法
./configure --prefix={DIR} && make && make install
三、boost的安装方法:
./bootstrap.sh && ./b2 install --prefix={dir}
三、openssl的安装方法
./configure shared
--prefix={DIR} && make && make install
四、thrift安装方法:
a. export LD_LIBRARY_PATH=/data/thrift/boost/lib:/data/thrift/libevent/lib:/data/thrift/openssl/lib 不然make的时候会出现 malloc和realloc未声明的错误
b. ./configure --with-libevent=/data/thrift/libevent --with-boost=/data/thrift/boost --prefix=/data/thrift/thrift CPPFLAGS=-I/data/thrift/openssl/include LDFLAGS=-L/data/thrift/openssl/lib && make && make install