美文网首页
centos7安装Thrift

centos7安装Thrift

作者: 塔塔七 | 来源:发表于2019-02-16 15:05 被阅读0次

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  //查看是否生成

相关文章

网友评论

      本文标题:centos7安装Thrift

      本文链接:https://www.haomeiwen.com/subject/vzebeqtx.html