scribe日志系统安装笔记

scribe日志系统安装笔记

目前web访问日志为crontab定时清空,而且负载均衡后,访问随机分配到一台服务器。程序出错后需要分析日志时,需要登录几台机器查看,于是想用一台主机作日志主机,负责收集(按时间顺序而不用sort?)、分析日志。下面的是年前安装scribe日志系统的记录。

一、软件下载 
wget http://www.monkey.org/~provos/libevent-2.0.10-stable.tar.gz
wget http://nchc.dl.sourceforge.net/project/boost/boost/1.45.0/boost_1_45_0.tar.bz2
wget http://apache.etoak.com//incubator/thrift/0.5.0-incubating/thrift-0.5.0.tar.gz
wget https://download.github.com/facebook-scribe-2ee14d3.tar.gz
wget http://cloud.github.com/downloads/facebook/scribe/scribe-2.2.tar.gz
二、安装步骤 
1
4系统已经安装过,下面安装略过,未安装的可yum install libevent进行安装。
1
gcc> 3.3.5 
gcc -v
which gcc
2
、安装ruby 
3
、安装python 
4
、安装libevent 
5
、安装 boost 
tar jxvf boost_1_45_0.tar.bz2
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
6
、安装facebook 服务 
安装thrift tar zxvf thrift-0.5.0.tar.gz
cd thrift-0.5.0
./configure --with-boost=/usr/local/boost --with-php-config=/usr/local/php5/bin/php-config
make
(出现如下错误,编辑文件lib/cpp/src/concurrency/ThreadManage.h修改为
24 #include <boost/tr1/tr1/functional>后,重新make)
 

make install
安装fb303
cd contrib/fb303

(目录下没有Makefile.in,将thrift目录下的Makefile.infb303目录下)
./bootstrap.sh
./configure --with-boost=/usr/local/boost
make
make install
7
、安装scribe 
环境变量
export BOOST_ROOT=/usr/local/boost
export LD_LIBRARY_PATH=/usr/local/boost/lib::/usr/lob:/usr/local/lib
ldconfig -v
tar zxvf facebook-scribe-2ee14d3.tar.gz (scribe需要在github上下载最新版,scribe2.2发布版与thrift0.5.0不兼容,
Ying-Yi Liang搞定并更新了)

cd facebook-scribe-2ee14d3
./bootstrap.sh
./configure --with-boost=/usr/local/boost --prefix=/usr/local/scribe
make
make install

8
、配置测试 
mkdir /usr/local/scribe/conf
cp examples/example1.conf /usr/local/scribe/conf
/usr/local/scribe/bin/scribed -c /usr/local/scribe/conf/example1.conf
/usr/local/scribe/bin/scribed -c /usr/local/scribe/conf/example1.conf &
nohup /usr/local/scribe/bin/scribed -c /usr/local/scribe/conf/example1.conf &
exit

测试程序:
mkdir  /tmp/scribetest
测试写入:
echo  "hello world"| /usr/local/softs/facebook-scribe-2ee14d3/examples/scribe_cat test
查看结果:
cat  /tmp/scribetest/test/test_current

 

9、配置PHP接口

 1)生成PHP库及配置目录

cd /usr/local/scribe

2)编写测试程序:

3)执行程序:

/usr/local/php5/bin/php test.php
4)查看结果:
cat /tmp/scribetest/keyword/keyword_current


三、相关文章 
多个服务器日志的排序合并: clfmerge
scribe
的安装与使用 
scribe-
日志收集器分析
使用Scribe来监控大型网络系统
nginx-scribe-log
Scribe PHP logging
Pipe Apache (or any) Logs to Scribe

 

参考:

scribe日志系统安装笔记
Facebook scribe在Ubuntu下面安装笔记

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值