Chinaunix首页 | 论坛 | 博客
  • 博客访问: 85359
  • 博文数量: 19
  • 博客积分: 487
  • 博客等级: 下士
  • 技术积分: 205
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-18 15:57
文章分类

全部博文(19)

文章存档

2011年(19)

我的朋友

分类: 服务器与存储

2011-06-23 16:10:27

(1)       安装 g++

(2)       安装 ruby sudo apt-get install ruby1.8-dev( 因为在后面要安装 thrift 需要 require mkmf, 因此必须安装 ruby1.8-dev)

(3)       安装 python: 一般系统会自带,但后后面安装的时候会报告说缺少 Python.h 这个文件,因此必须安装 python-dev 这个包。所以最好这里重新安装一下 python ,安装命令如下 : sudo apt-get install python-dev

(4)       安装 libevent:

1.       首先下载这个包 wget

2.       tar –xvf libevent-2.0.10-statble.tar.gz

3.       ./configure

4.       make

5.       make install

(5)       安装 php

1.       必须先安装 libxml2 ,然后在安装 php, 下载 libxml2: Libxml2 的安装包下载地址: ,下载 libxml2-2.7.4.tar.gz

2.       Tar –xvf libxml2-2.7.4.tar.gz

3.       Configure

4.       Make

5.       Make install

6.       下载 php: Php 下载地址 ,下载了

7.       Tar –vxf 

8.       ./configure --prefix=/usr/local/php5 --with-php-config=/usr/local/php5/bin/php-config (因为在 scribe 的一些版本中用到 php-config ,所以这里面要用 —with-php-config ,但是在我的安装过程没有用到,所以这个可以忽略)

9.       Make

10.   Make install

(6)       安装 boost

1.                        Wget

2.                        tar jxvf boost_1_45_0.tar.bz2

3.                        cd boost_1_45_0

4.                        sudo apt-get install zlib2-dev( 因为我的系统在安装的时候报错了,说是缺少 zlib.h 文件,因此我必须得安装这个包,才能进行后续的操作 )

5.                        ./bootstrap.sh

6.                        ./bjam -s HAVE_ICU=1 --prefix=/usr/local/boost --includedir=/usr/local/boost/include --libdir=/usr/local/boost/lib

7.                        ./bjam install --prefix=/usr/local/boost

 

(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 >&)’ 这个错误,后来查了一下,说是因为 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 ,但是现在网上找不到这个包,忙乎了一大通,后来终于搞清楚了,现在要去 这个网站,选择右上角的 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, some problem will be occur like the picture as follows:

you can fix it: vi src/gen-cpp/scribe_types.cpp and delete ReulstCode:: in line 11 & 12.

another bug also maybe exist, this is direct_iter->filename(), this problem result in different version of boost::filesystem, you can write it like this: direct_iter->path().filename().string(), bwt, i use the version 1.46.0 of boost.

7.       make install

(9)       测试

还是在 pcting-scribe-2ee14d3/examples 这个目录下,有一个 README 文件,里面举例如何测试 scribe 是否安装和运行正常的。

mkdir /tmp/scribetest

pcting-srcibe-2ee14d3 目录下执行:

src/scribed examples/example1.conf 如果显示类似下面的内容,表示成功启动 scribe

[Wed Feb 16 21:21:29 2011] "setrlimit error (setting max fd size)"

[Wed Feb 16 21:21:29 2011] "STATUS: STARTING"

[Wed Feb 16 21:21:29 2011] "STATUS: configuring"

[Wed Feb 16 21:21:29 2011] "got configuration data from file "

[Wed Feb 16 21:21:29 2011] "CATEGORY : default"

[Wed Feb 16 21:21:29 2011] "Creating default store"

[Wed Feb 16 21:21:29 2011] "configured <1> stores"

[Wed Feb 16 21:21:29 2011] "STATUS: "

[Wed Feb 16 21:21:29 2011] "STATUS: ALIVE"

[Wed Feb 16 21:21:29 2011] "Starting scribe server on port 1463"

Thrift: Wed Feb 16 21:21:29 2011 libevent 2.0.10-stable method epoll

退出当前状态,然后执行

Nohup src/scribed examples/example1.conf & (让其后台运行)

设置变量 export PYTHONPATH= /usr/lib/python2.5/site-packages

然后执行 echo "hello world" | ./scribe_cat test

看看 cat /tmp/scribetest/test/test_current 里面的结果是不是 hello world?? 是就 ok 了,不是那就悲剧了。

阅读(1903) | 评论(0) | 转发(0) |
0

上一篇:TCP Proxy Server

下一篇:Just one last dance

给主人留下些什么吧!~~