(7) 安装 thrift
因为 thrift 的安装决定了后面的 scribe 的安装,我开始安装 thrift-0.5.0.tar.gz 这个版本的,但在 scribe 的时候会一直报: scribe_server.h:45: error: conflicting return type specified for ‘virtual scribe::thrift::ResultCode scribeHandler::Log(const std::vector<scribe::thrift::LogEntry, std::allocator<scribe::thrift::LogEntry> >&)’ 这个错误,后来查了一下,说是因为 thrift 的 0.5.0 版本有问题,因此这在里应该选择 thrift-0.4.0.tar.gz 这个版本(我是在 2011-2-17 日安装的,可能在后面的版本会修复这个 bug 吧)。
1. 下载 thrift: http://apache.etoak.com//incubator/thrift/ 在这里选择 0.4.0 ,具体下载 wget http://apache.etoak.com//incubator/thrift/0.4.0-incubating/thrift-0.4.0.tar.gz
2. 因为我在 thrift 过程中报了很多错误,我把所有需要的系统的包全部安装了一下,具体有如下这些 sudo apt-get install libghc6-http-dev libghc6-binary-dev libboost-iostreams-dev libboost-filesystem-dev libboost-dev automake libtool flex bison pkg-config g++ ant ivy libslf4j-Java libcommons-lang-java liblog4j1.2-java automake1.10
3. tar -xvf thrift-0.4.0.tar.gz
4. cd thrift-0.4.0
5. ./configure --with-boost=/usr/local/boost ( 在 0.5.0 里面可能需要 --with-php-config=/usr/local/php5/bin/php-config, 但在 0.4.0 里面是不需要的 )
6. Make
7. make install
安装 fb303
8. cd contrib/fb303
9. ./bootstrap.sh
10. ./configure --with-boost=/usr/local/boost
11. make
12. make install
(8) 安装 scribe
下载 scribe ,网上的资料都是说要安装 facebook-scribe-2ee14d3.tar.gz ,但是现在网上找不到这个包,忙乎了一大通,后来终于搞清楚了,现在要去 https://github.com/pcting/scribe/ 这个网站,选择右上角的 Downloads 这个按钮,选择下载 .tar.gz 文件,下载下来的文件是 pcting-scribe-2ee14d3.tar.gz 文件。注意这个网站下面有一些 message ,会针对某些安装过程报的 bug 做出一些解释,可以翻看一下。
1. 设置变量: export BOOST_ROOT=/usr/local/boost
export LD_LIBRARY_PATH=/usr/local/boost/lib::/usr/lob:/usr/local/lib
ldconfig –v
2. tar –xvf pcting-scribe-2ee14d3.tar.gz
3. cd pcting-scribe-2ee14d3
4. ./bootstrap.sh
5. ./configure --with-boost=/usr/local/boost --prefix=/usr/local/scribe
6. Make
7. make install
