1、安装依赖
yum -y install automake libtool flex bison pkgconfig gcc-c++ boost-devel libevent-devel zlib-devel python-devel ruby-devel openssl-devel
2、安装thrift
wget "http://mirror.bit.edu.cn/apache/thrift/0.10.0/thrift-0.10.0.tar.gz"
./configure --with-boost=/usr/local
make -j24
make install
3、验证是否安装成功
thrift -version
4、验证是否可执行
mkdir -p /home/wwwroot/thrift
cd /home/wwwroot/thrift
vi demo.thrift
注:内容如下
namespace java com.ishuber.demo //java
namespace py thrift.demo //python
service DemoService {
void sayHello(1:string name);
}
thrift -gen java demo.thrift //生成java文件
ls //查看是否生成