scribe安装

关于Scribe集中式日志服务器的安装、配置与使用

[libevent] Event Notification library
[boost] Boost C++ library (version 1.36 or later)
[thrift] Thrift framework (version 0.5.0 or later)
[fb303] Facebook Bassline (included in thrift/contrib/fb303/)
fb303 r697294 or later is required.
[hadoop] optional. version 0.19.1 or higher (http://hadoop.apache.org)

thrift也依赖与boost
[size=x-large]一、安装thrift[/size]
见[url]http://running.iteye.com/blog/1983463[/url]


[size=X-large]三、安装Scribe[/size]
项目地址:https://github.com/facebook/scribe
wget https://github.com/downloads/facebook/scribe/scribe-2.2.tar.gz

下载facebook-scribe-2ee14d3.tar.gz
./bootstrap.sh --with-boost=/usr/local/boost
./configure --prefix=/usr/local/scribe --with-boost=/usr/local/boost --with-thriftpath=/usr/local/thrift
make
make install


#禁用优化,打开调试模式(默认情况下是打开优化的)
./configure --disable-opt

# To disable static libraries and enable shared libraries. [ default has been set to static]
./configure --disable-static

# To build scribe with Hadoop support
./configure --enable-hdfs

# If the build process cannot find your Hadoop/Jvm installs, you may need to specify them manually:
./configure --with-hadooppath=/usr/local/hadoop --enable-hdfs CPPFLAGS="-I/usr/local/java/include -I/usr/local/java/include/linux" LDFLAGS="-ljvm -lhdfs"

# To set thrift home to a non-default location
./configure --with-thriftpath=/myhome/local/thrift

# If Boost is installed in a non-default location or there are multiple Boost versions
# installed, you will need to specify the Boost path and library names
./configure --with-boost=/usr/local --with-boost-system=boost_system-gcc40-mt-1_36 --with-boost-filesystem=boost_filesystem-gcc40-mt-1_36

[size=X-large]四、配置scribe[/size]

cd examples
cp scribe_c* /usr/local/scribe/bin/

mkdir -p /usr/local/scribe/conf
cd /usr/local/scribe/conf
vim scribe.conf

参考examples下的配置


[size=X-large]五、测试[/size]
进入安装后的目录/usr/local/scribe
mkdir conf
cp ~/facebook-scribe-2ee14d3/examples/example1.conf /usr/local/scribe/conf/

启动,默认端口是1463
/usr/local/scribe/bin/scribed -c /usr/local/scribe/conf/example1.conf


测试程序:
mkdir  /tmp/scribetest

测试写入:
echo  "hello world"| /usr/local/scribe/bin/scribe_cat test

查看结果:
cat  /tmp/scribetest/test/test_current



[size=X-large]六、其它[/size]
[size=large]scribe支持hdfs[/size]
1.编译hadoop,支持c++接口
ant compile-c++-libhdfs -Dislibhdfs=true
编译完以后,会在hadoop的跟目录生成c++的目录
2.编译scribe
./bootstrap.sh --with-boost=/usr/local/boost --enable-hdfs
./configure --with-boost=/usr/local/boost --prefix=/usr/local/scribe --with-hadooppath=/usr/lib/hadoop/ --enable-hdfs


[size=large]生成客户端[/size]
生成Scribe的java客户端
cd facebook-scribe-2ee14d3/if/
thrift -r -I ../../thrift-0.5.0/contrib/ -gen java scribe.thrift
这里需要指到你的thrift的源码目录

生成thrift的java客户端
cd thrift-0.5.0/lib/java
ant
生成libthrift.jar

[size=X-large]七、常见异常[/size]
1.编译scribe时,所报错误:
checking whether the Boost::System library is available… yes
checking whether the Boost::Filesystem library is available… yes
configure: error: Could not link against !

解决办法,在configure 后加一个参数 --with-boost-filesystem=boost_filesystem

1.启动Scribe时,所报错误:

scribed: error while loading shared libraries: libboost_filesystem.so.1.45.0:
cannot open shared object file: No such file or directory

这是因为找不到libboost_filesystem.so.1.45.0
查找find / -name libboost_filesystem.so.1.45.0
解决办法:
1.通过软连接过去
ln -s /usr/local/boost/lib/libboost_filesystem.so.1.45.0 /usr/lib/libboost_system.so.1.45.0
2.配置export
export LD_LIBRARY_PATH=/usr/local/boost/lib:/usr/local/lib/:/usr/lib/
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值