Ubuntu 12.04 安装scribe 的笔记

首先,如果你不是很熟悉C++,请放弃安装scribe。这个项目有年头没更新了,分布式日志写入可以考虑haodoop的flume或是支持MongoDB,能直接获取scribe输出的fluentd。其次,建议按照这篇笔记记录的版本,或者手动修改代码,让scribe支持高版本的filesystem以及各种库,否则必然会出现各种错误。而且这些问题虽然是同样的报错但在Google上有各种千奇百怪的解释。

scribe依赖Boost库,用thrift实现跨语言,还需要fb303来做监控。在CentOS上找到了rpm包,在Ubuntu上,apt-get 安装的版本都是最新的,scribe用不了,都要手动安装…(稍微能体会到这篇笔记的艰辛了吗?=_,=)

在装坏一台vps后开始使用build目录…

mkdir scribe-build

cd scribe-build

mkdir dist

Install boost

http://sourceforge.net/projects/boost/files/boost/1.41.0/

cd boost_1_41_0

./bootstrap.sh --prefix=`pwd`/../dist

./bjam install

cd ..

还有libevent,没装就用apt-get顺便装上:

sudo apt-get install libevent-dev

Thrift && fb303

http://archive.apache.org/dist/incubator/thrift/0.5.0-incubating/

cd thrift

export PY_PREFIX=`pwd`/../dist

./configure --prefix=`pwd`/../dist --with-boost=`pwd`/../dist

make

sudo mak install

cd ..

下载的thrift包含fb303,在contrib目录下:

cd contrib/fb303

export PY_PREFIX=`pwd`/../../../dist

./bootstrap.sh --with-thriftpath=`pwd`/../../../dist --with-boost=`pwd`/../../../dist --prefix=`pwd`/../../../dist

make

sudo make install

cd ../../..

Install scribe

以上就算装完所有依赖的库了,如果缺少必要的库,编译时会有明确的提示,最后下载运行scribe。

https://github.com/downloads/facebook/scribe/scribe-2.1.tar.gz

设置各种需要用到的路径,注意其中java的版本和路径

export LD_LIBRARY_PATH=”`pwd`/../dist/lib:”"/usr/lib/jvm/java-6-openjdk/jre/lib/amd64/:”"/usr/lib/jvm/java-6-openjdk/jre/lib/amd64/server”

export CFLAGS=”-I/usr/lib/java-6-openjdk/include/linux/”

export LDFLAGS=”-L`pwd`/../dist/lib “”-L/usr/lib/jvm/java-6-openjdk/jre/lib/amd64 “”-L/usr/lib/jvm/java-6-openjdk/jre/lib/amd64/server”

export LIBS=”-lhdfs -ljvm”

./bootstrap.sh --with-boost=`pwd`/../dist --with-thriftpath=`pwd`/../dist --with-fb303path=`pwd`/../dist --prefix=`pwd`/../dist

make

sudo make install

configure出错提示很明确。我之前是一直卡在make命令,花了几个小时才解决各种报错。只要make执行成功就真算是大功告成了。

cd dist

export LD_LIBRARY_PATH=”`pwd`/lib”

./bin/scribed ../scribe-2.1/examples/example1.conf

[Sun Apr 22 00:16:46 2012] “setrlimit error (setting max fd size)”

[Sun Apr 22 00:16:46 2012] “STATUS: STARTING”

[Sun Apr 22 00:16:46 2012] “STATUS: configuring”

Thrift: Sun Apr 22 00:16:46 2012 libevent 1.4.13-stable method epoll

以上,祝各位好运,出了问题请直接请教scrbie的Google Group,本人不负责解答,因为C++我也不懂 = =||

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。