大数据应用日志采集之Scribe 安装配置指南

大数据应用日志采集之Scribe 安装配置指南

1.概述

Scribe是Facebook开源的日志收集系统,在Facebook内部已经得到大量的应用。它能从各种日志源收集日志,存储到一个中央存储系统上,便于进行集中统计分析处理。它为日志的”分布式收集,统一处理”提供了一个可扩展的,高容错的方案。scribe代码很简单,但是安装配置却很复杂,本文记录了作者实际的一次安装的过程,感觉真是不一般的琐碎,另外Scribe开源社区的版本已经是几年前的版本了,最新的维护信息一致没有看到,HDFS和Thrift的版本使用的都是比较旧的版本,考虑另开一个分支,升级一下Scribe,看到时候有没有时间了。

2.Scribe 安装

Scribe 依赖于多个环境,有pthyon,boost,thirft,libevent,openssl等。在编译的时候还有一些编译错误需要进行修正,安装的和准备如下。

2.1 环境准备

  1.安装编译环境

#yum install gcc-c++ libevent libevent-devel automake autoconf m4 bison zlib zlib-devel bzip2 bzip2-devel flex pkgconfig python python-devel ruby ruby-devel mono-devel libxml2 libxml2-devel ant openssl-devel

  2.安装boost环境:最低版本1.36

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

#tar zxvf boost_1_45_0.tar.gz

#cd boost_1_45_0

#./bootstrap.sh

#./bjam

 #./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

#echo "/usr/local/boost/lib" >> /etc/ld.so.conf

#echo /usr/local/boost/include >> /etc/ld.so.conf

#ldconfig

  3. 安装thrift环境

  #wget https://dist.apache.org/repos/dist/release/thrift/0.9.0/thrift-0.9.0.tar.gz

#tar xzvf thrift-0.9.0.tar.gz

#./configure --prefix=/usr/local/thrift --with-boost=/usr/local/boost --with-java=no  --with-erlang=no  --with-perl=no  --with-php=no  --with-ruby=no

 备注:如果提示找不到libcrpty增加openssl路径

 ./configure --prefix=/usr/local/thrift --with-boost=/usr/local/boost --with-java=no  --with-erlang=no --with-perl=no --with-php=no  --with-  ruby=no CPPFLAGS="-I/usr/local/openssl/include" LDFLAGS="-ldl -L/usr/local/openssl/lib"

 修改文件:

  Thrift/lib/ src/thrift/Thrift.cpp 增加头文件:#include<stdlib.h>

同时修改config.h文件,注释掉:

/* Define to rpl_malloc if the replacement function should be used. */

//modby zhangzl++:

//#define malloc rpl_malloc

//--

/* Define to rpl_realloc if the replacement function should be used. */

//modby zhangzl++:

//#define realloc rpl_realloc

//--

#make

#make install

# echo "/usr/local/thrift/lib" >> /etc/ld.so.conf

#ldconfig

#cd contrib.

  4.安装fb303

#cd fb303

#./bootstrap.sh

#./configure --prefix=/usr/local/thrift/fb303 --with-boost=/usr/local/boost/ --with-thriftpath=/usr/local/thrift

#make

//注意修改观察生成的Makefile关于头文件和库文件路径的信息是否正确,如果正确则可以直接编译。

#make install

4.安装scribe

https://github.com/facebook/scribe下载zip包。

#unzip scribe-master.zip

#cd scribe-master

# export BOOST_ROOT=/usr/local/boost

#export LD_LIBRARY_PATH=/usr/local/thrift/lib:/usr/lib:/usr/local/lib:/usr/local/boost/lib:/usr/local/thrift/fb303/lib

#./bootstrap.sh  --with-boost=/usr/local/boost --with-boost-filesystem=boost_filesystem

遇到问题:

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

#./configure --prefix=/usr/local/scribe --with-boost=/usr/local/boost --with-thriftpath=/usr/local/thrift  --with-fb303path=/usr/local/thrift/fb303 --with-boost-filesystem=boost_filesystem

#make

遇到问题:

  1. thrift/server/TNonblockingServer.h:40:19: error: event.h: No such file or directory
  2. 安装Libevent

#tar zxvf libevent-2.0.18-stable.tar.gz
#cd libevent-2.0.18-stable
#./configure –prefix=/usr/local/libevent
#make
#make install

  3.安装libevent-devel

yum install libevent-devel

error: there are no arguments to 'htons' that depend on a template parameter, so a declaration of 'htons' must be available

需要自己修改一下文件:

vim /usr/local/thrift/include/thrift/protocol/TBinaryProtocol.tcc

在首行添加头文件引用: #include <arpa/inet.h>

#echo /usr/local/libevent/include >> /etc/ld.so.conf

#ldconfig

#make install

2.2 测试

#cp example/example1.conf  /tmp

#/usr/local/scribe/bin/scribed /tmp/example1.conf

进行测试。

如果失败,根据提示信息,进行相应修改。

我启动时出现下面的错误:

./scribed: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory

解决办法是find这个库文件libevent-2.0.so.5,拷贝到/usr/lib64目录下。

启动成功后,出现下面的界面:

3.Scribe配置

Scribe 的配置解析见http://my.oschina.net/guol/blog/110258

测试通过的server端和client端的配置文件如下:

  1. Server.conf

port=1463

max_msg_per_second=100000000

max_queue_size=10000000

check_interval=1

new_thread_per_category=true

<store>

category=squid

type=file

file_path=/tmp/test/logcollect/

base_filename=21vianet__squid_access_all_

rotate_period=daily

rotate_hour=0

rotate_minute=0

max_size=1610612736

add_newlines=0

</store>

  1. Client.conf

port=1464

max_msg_per_second=2000000

max_queue_size=1000000

check_interval=1

new_thread_per_category=true

<store>

category=default

type=buffer

target_write_size=20480

max_write_interval=1

buffer_send_rate=2

retry_interval=30

retry_interval_range=10

<primary>

type=network

#remote_host=218.93.205.106

remote_host=192.168.11.95

remote_port=1463

</primary>

<secondary>

type=file

fs_type=std

write_meta=no

file_path=/tmp/test/scribed

base_filename=accesslog

max_size=100000000

add_newlines=0

</secondary>

</store>

注意:

在server端接收的日志,将以文件的方式来记录log,这个文件不能删除,它是个软连接。需要先copy过去,再调用touch命令将文件清空。

作者:张子良 
出处:http://www.cnblogs.com/hadoopdev 
本文版权归作者所有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

大数据应用日志采集之Scribe 安装配置指南的更多相关文章

  1. 大数据应用日志采集之Scribe演示实例完全解析

    大数据应用日志采集之Scribe演示实例完全解析 引子: Scribe是Facebook开源的日志收集系统,在Facebook内部已经得到大量的应用.它能够从各种日志源上收集日志,存储到一个中央存储系 ...

  2. CentOS6安装各种大数据软件 第八章:Hive安装和配置

    相关文章链接 CentOS6安装各种大数据软件 第一章:各个软件版本介绍 CentOS6安装各种大数据软件 第二章:Linux各个软件启动命令 CentOS6安装各种大数据软件 第三章:Linux基础 ...

  3. C#实现多级子目录Zip压缩解压实例 NET4.6下的UTC时间转换 [译]ASP.NET Core Web API 中使用Oracle数据库和Dapper看这篇就够了 asp.Net Core免费开源分布式异常日志收集框架Exceptionless安装配置以及简单使用图文教程 asp.net core异步进行新增操作并且需要判断某些字段是否重复的三种解决方案 .NET Core开发日志

    C#实现多级子目录Zip压缩解压实例 参考 https://blog.csdn.net/lki_suidongdong/article/details/20942977 重点: 实现多级子目录的压缩, ...

  4. asp.Net Core免费开源分布式异常日志收集框架Exceptionless安装配置以及简单使用图文教程

    最近在学习张善友老师的NanoFabric 框架的时了解到Exceptionless : https://exceptionless.com/ !因此学习了一下这个开源框架!下面对Exceptionl ...

  5. 【转】asp.Net Core免费开源分布式异常日志收集框架Exceptionless安装配置以及简单使用图文教程

    最近在学习张善友老师的NanoFabric 框架的时了解到Exceptionless : https://exceptionless.com/ !因此学习了一下这个开源框架!下面对Exceptionl ...

  6. 【转】Syncthing – 数据同步利器---自己的网盘,详细安装配置指南,内网使用,发现服务器配置

    Syncthing – 数据同步利器---自己的网盘,详细安装配置指南,内网使用,发现服务器配置 原贴:https://www.cnblogs.com/jackadam/p/8568833.html ...

  7. 高可用,完全分布式Hadoop集群HDFS和MapReduce安装配置指南

    原文:http://my.oschina.net/wstone/blog/365010#OSC_h3_13 (WJW)高可用,完全分布式Hadoop集群HDFS和MapReduce安装配置指南 [X] ...

  8. [转载]SharePoint 2013测试环境安装配置指南

    软件版本 Windows Server 2012 标准版 SQL Server 2012 标准版 SharePoint Server 2013 企业版 Office Web Apps 2013 备注: ...

  9. 【转】服务器证书安装配置指南(Weblogic)

    服务器证书安装配置指南(Weblogic) 详情请点击: http://verisign.itrus.com.cn/html/fuwuyuzhichi/fuwuqizhengshuanzhuangpe ...

随机推荐

  1. Google Guice结合模式

    于Guice于,喷油器装配工作是一个对象图,当请求类型实例,喷油器根据推断对象如何映射到创建的实例.解决依赖.要确定如何解决的依赖就需要配置喷油器结合的方式. 要创建绑定(Binding)对象,能够继 ...

  2. C--运算符,表达式和语句实例

    //第五章 运算符,表达式和语句 #include<stdio.h> //引入头文件 #include<math.h> #define ADJUST 7.64 //定义常量 # ...

  3. Asp.net MVC + EF + Spring.Net 项目实践(一)

    准备用几篇文章来做一个MVC的例子,为了给新同事做参考,也为自己做个知识储备. 首先,用VS2013创建一个空白解决方案StudentManageSystem,然后添加一个MVC应用程序(可参考ASP ...

  4. PHP添加Mssql/sqlserver2000扩展,适用于Php5.2/Php5.3/Php5.4

    原文:PHP添加Mssql/sqlserver2000扩展,适用于Php5.2/Php5.3/Php5.4 本文介绍如何在Windows下配置php扩展. 本文链接 http://blog.csdn. ...

  5. ZOJ 2675 Little Mammoth(计算几何)

    圆形与矩形截面的面积 三角仍然可以做到这一点 代码: #include<stdio.h> #include<string.h> #include<stdlib.h> ...

  6. 微信应用号开发知识贮备之altjs官方实例初探

    天地会珠海分舵注:随着微信应用号的呼之欲出,相信新一轮的APP变革即将发生.从获得微信应用号邀请的业内人士发出来的一张开发工具源码截图可以看到,reacjs及其相应的FLUX框架altjs很有可能会成 ...

  7. SQL点滴7—使用SQL Server的attach功能出现错误及解决方法

    原文:SQL点滴7-使用SQL Server的attach功能出现错误及解决方法 今天用SQL Server 2008的attach功能附加一个数据库,出了点问题,提示的错误是: Unable to ...

  8. SSI框架总结

    先来点文字性的描写叙述: MVC对于我们来说,已经不陌生了,它起源于20世纪80年代针对smalltalk语言的一种软件设计模式,如今已被广泛应用.近年来,随着java的盛行,MVC的低耦合性.高重用 ...

  9. 大数据时代:基于微软案例数据库数据挖掘知识点总结(Microsoft 聚类分析算法)

    原文:(原创)大数据时代:基于微软案例数据库数据挖掘知识点总结(Microsoft 聚类分析算法) 本篇文章主要是继续上一篇Microsoft决策树分析算法后,采用另外一种分析算法对目标顾客群体的挖掘 ...

  10. Crystal Report 在 VS 2010 中的使用和发布

    原文:Crystal Report 在 VS 2010 中的使用和发布 使用: 打开CrystalReport官网下载页 目前最新版本为13.0.4 选择“SAP Crystal Reports, v ...