`
奔跑的羚羊
  • 浏览: 574841 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

thrift-0.5.0安装

阅读更多

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

    2. **编译脚本**:如`configure`和`makefile`,用于在Linux环境下编译和安装Thrift。 3. **Thrift IDL文件**:展示了如何使用Thrift IDL来定义服务和数据结构的示例。 4. **生成工具**:Thrift编译器`thrift`,用于...

    libthrift-0.5.jar

    thrift所需的支持jar包之一,libthrift-0.5.jar包

    libthrift任意版本的地址

    通过定义一个简单的IDL(接口定义语言),Thrift可以生成各种编程语言的代码(如C++, Java, Python等),使得不同语言之间能够高效地进行通信。libthrift则主要是指Thrift项目中的C++库部分。 ### 二、libthrift的...

    thrift介绍与实践

    `thrift-0.5.0.exe`是Thrift编译器,它会根据`.thrift`文件生成不同编程语言的客户端和服务端代码。例如,如果你选择Java作为目标语言,Thrift编译器会生成对应的Java接口、实现类以及序列化/反序列化的代码。这样,...

    分布式检索

    5. **Thrift-0.5.0**: Thrift是一个跨语言的服务开发框架,用于构建可伸缩的分布式服务。在这里可能是用于Lucandra.Net和Cassandra之间的通信。 6. **Highlighter.Net-2.3.2**: 可能是一个文本高亮库,用于在搜索...

    libQtCassandra_0.5.0

    libQtCassandra 0.5.0 修复了 QCassandraRow::exists() 函数的问题,更新了 Thrift 库。 libQtCassandra 是一个高级的 C++ 库用来访问 Cassandra 这个 NoSQL 服务器,使用 Qt 风格的类设计,可直接在 Qt 中使用。

    javase源码-indextank-service:IndexTank的API、BackOffice、Storefront和Nebulize

    Thrift 库(提供了 0.5.0 版本的生成源)源定义: 入门: 创建数据库架构 (python manage.py syncdb)。 创建一个帐户。 启动一个索引实例(IndexTank 引擎)。 启动 API。 应用程序接口 实现 REST JSON API 的 ...

    RPC_reactive:RPC系统如何工作的示例和解释

    作者PabloPérezGarcía React式RPC 在这里,我们用一些示例和解释来介绍最著名的RPC作为或工作方式。 gRPC 简单的gRCP gRPC如何在客户端-服务器之间工作的示例 ... <version>0.5.0 <configuration>

Global site tag (gtag.js) - Google Analytics