当前位置: 首页 > 工具软件 > Scribe > 使用案例 >

scribe安装笔记

谭山
2023-12-01
 前几天项目中用到的scribe日志系统。于是乎去网上看了一些资料。比较少,不过还是有一些的。又于是乎开始装。。。。结果装了5遍。还是没装上,怎么都编不过去。我快到崩溃的状态了。但是我还是比较死心眼的。。就是开始了第6回。T_T。


这次装的时候我把日志都打出来了。一步一步看。终于在此刻,装成功了。。。太不容易了。所以记录一下。。防止以后忘了。。


不说废话了。下面是我的安装步骤。仅供参考。


安装环境:

CentOS5.5

boost_1_45_0.tar.gz
thrift-0.5.0.tar.gz
facebook-scribe-2ee14d3.tar.gz


其实安装不成功的原因就是包的依赖太多,又不愿意看日志。所以就一次次失败。


首先。我们必须装一些开发工具。。(注意:cent自带的不全。建议您把以下的工具都装一遍)


用yum装就行


ruby,ruby-devel,python,python-devel,automake,libtool,flex,bison,pkgconfig,gcc-c++,boost-devel,libevent-devel,libevent,zlib-devel,mono-devel,boost,libxml2,libxml-devel,bzip,bzip-devel


装完的话,开始装php


Tar –vxf PHP 5.3.5.tar.gz

./configure --prefix=/usr/local/php5

Make

Make install


接下来boost。这里比较重要。如果有报错,一定要看(我之前就是没装bzip)

wget http://nchc.dl.sourceforge.net/project/boost/boost/1.45.0/boost_1_45_0.tar.bz2

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

安装thrift

tar zxvf thrift-0.5.0.tar.gz
./configure –with-php-config=/usr/local/php/bin/php-config –with-boost=/usr/local/boost/ –with-java
make
make install

安装fb303

cd contrib/fb303
./bootstrap.sh –with-boost=/usr/local/boost/
make
make install

最后安装scribe

export BOOST_ROOT=/usr/local/boost

export LD_LIBRARY_PATH=/usr/local/boost/lib:/usr/lib:/usr/local/lib

ldconfig –v

tar –xvf facebook-scribe-2ee14d3.tar.gz

cd facebook-scribe-2ee14d3

./bootstrap.sh

./configure --with-boost=/usr/local/boost --prefix=/usr/local/scribe

Make

make install

如果到这都没报错。
并且有/usr/local/scribe目录
那么恭喜你。已经成功99%了

接下来测试一下。

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 <examples/example1.conf>"

[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.4/site-packages

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

看看 cat /tmp/scribetest/test/test_current 里面的结果是不是 hello world

如果是,那就100%了。呵呵。
 类似资料: