Scribe安装

Scribe 是Facebook 开源的分布式日志系统 。 可以用java 借助log4j 向分布式Scribe 写入日志。下面来学习一下Scribe系统的安装。
一、软件下载

依赖关系如下图:

 


二、安装步骤

1、输入gcc –v 检查gcc版本是否>3.3.5 是,则继续下一步。否,则安装gcc 。

2、安装 boost 1.33.1+

$tar zxvf boost_1_45_0.tar.gz
$cd boost_1_45_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/lib:/usr/local/lib
ldconfig -v

3、安装ruby 和python python 用默认安装路径。

Ruby 推荐使用默认路径 安装过程均为./configure make make install

4、安装lievent 解压安装即可

安装过程为./configure make make install  

5、安装 php 和libxml2

先安装libxml2 (php依赖它) 在安装php(默认安装路径)

安装过程均为./configure make make install

6、安装facebook 服务-- thrift 和 fb303

首先解压并进入thrift 目录 ,thrift的安装详细请参见上文

$./configure --with-boost=/usr/local/boost --with-php-config=/usr/local/bin/php-config
$make
$make install

在当前目录 cd 到contrib/fb303/ :

$./bootstrap.sh --with-boost=/usr/local/boost/
$make
$make install

  7、安装scribe

$tar zxvf scribe-**.tar.gz
$cd scribe-**
$./bootstrap.sh --with-boost=/usr/local/boost --prefix=/usr/local/scribe
$./configure --with-boost=/usr/local/boost --prefix=/usr/local/scribe
$make
$make install

安装完毕。


三、配置测试

启动Scribe服务器

$mkdir /usr/local/scribe/conf
$cp /usr/local/scribe/examples/example1.conf /usr/local/scribe/conf
$/usr/local/scribe/bin/scribed -c /usr/local/scribe/conf/example1.conf

测试程序:

$mkdir  /tmp/scribetest
测试写入:
$echo  "hello world"| /usr/local/scribe/examples/scribe_cat test
查看结果:
$cat  /tmp/scribetest/test/test_current

 


参考资料

  • http://blog.chinaunix.net/space.php?uid=23265595&do=blog&id=2464880
  • http://blog.csdn.net/liuzhongbing/article/details/5676096
  • http://addcn.blogbus.com/logs/104688875.html
posted @ 2011-10-28 13:28  残夜  阅读(2170)  评论(0编辑  收藏  举报