日志收集系统 scribe on centos 安装
来源:互联网 发布:中国工业经济数据库 编辑:程序博客网 时间:2024/04/29 08:21
由于scribe是基于thrift服务框架开发的,所以需要先安装thrift,thrift又依赖很多工具和库.
首先安装依赖库
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
安装boost,当前安装的1.45 最低版本1.36
下载 boost_1_45_0.tar.bz2
解压 后进入目录
运行如下
./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
./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
.
添加环境变量
export BOOST_ROOT=/usr/local/boost
export LD_LIBRARY_PATH=/usr/local/boost/lib:/usr/local/lib/:/usr/lib/
export BOOST_ROOT=/usr/local/boost
export LD_LIBRARY_PATH=/usr/local/boost/lib:/usr/local/lib/:/usr/lib/
安装thrift
http://incubator.apache.org/thrift/
(版本>=0.5.0)
1)先安装thrift,
解压并进入thrift目录
(版本>=0.5.0)
1)先安装thrift,
解压并进入thrift目录
./configure CPPFLAGS=
"-DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H" --without-csharp --with-boost=/usr/local/boost
947 make
948 make install
查看版本 thrift -version
安装 fb303
在thrift 目录下已经存在此文件
cd contrib/
cd fb303/
./bootstrap.sh
./configure --with-boost=/usr/local/boost
cd fb303/
./bootstrap.sh
./configure --with-boost=/usr/local/boost
make
make install
安装scribe (从官网下载2.2 安装失败。。。。。)
https://github.com/facebook/scribe
下载2.0版本
解压后,进入scribe 目录
- ./bootstrap
--with-boost=/usr/local/boost - ./configure CPPFLAGS="-DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H" --with-boost=/usr/local/boost --prefix=/usr/local/scribe
- make
- make
install
三、测试
进入安装后的目录/usr/local/scribe
代码
- mkdir
conf - cp
~/facebook-scribe-2ee14d3/examples/example1.conf /usr/local/scribe/conf/
启动,默认端口是1463
python代码
- /usr/local/scribe/bin/scribed
-c /usr/local/scribe/conf/example1.conf
[Tue Mar 25 18:01:12 2014] "STATUS: STARTING"
[Tue Mar 25 18:01:12 2014] "STATUS: configuring"
[Tue Mar 25 18:01:12 2014] "got configuration data from file </usr/local/scribe/conf/example1.conf>"
如能看到如上结果,表示运行成功
测试程序:
代码
- mkdir
/tmp/scribetest
测试写入:
代码
- echo
"hello world" | 原目录/examples/scribe_cattest
查看结果:
代码
- cat
/tmp/scribetest/test/test_current
如果能看到hello world 表示正常
错误解决
安装scribe在make的时候出现如下错误:
1
undefined reference to `boost::system::generic_category()'
2
undefined reference to `boost::system::generic_category()'
3
undefined reference to `boost::system::system_category()'
4
解决办法1:
5
进入scribe源码包的scr目录执行如下:
6
g++ -Wall -O3 -L/usr/lib -o scribed store.o store_queue.o conf.o
file
.o conn_pool.o scribe_server.o network_dynamic_config.o dynamic_bucket_updater.o env_default.o -L/usr/
local
/lib -L/usr/
local
/lib -L/usr/
local
/lib -lfb303 -lthrift -lthriftnb -levent -lpthread libscribe.a libdynamicbucketupdater.a -lboost_system-mt -lboost_filesystem-mt
7
解决办法2:
8
在configure的时候加上-lboost_system-mt -lboost_filesystem-mt参数
-DBOOST_FILESYSTEM_VERSION=2 参数只有在你的boost版本大于1.46的时候需要添加
测试时错误:
1
root@py-6:~/scribe/examples
# echo "hello world"|./scribe_cat test
2
Traceback (most recent call last):
3
File
"./scribe_cat"
, line 24,
in
<module>
4
from scribe
import
scribe
5
ImportError: No module named scribe
6
7
解决办法
8
在debian/ubuntu系列安装完毕后,python的scribe模块并没有在默认搜索路径中,所以:
9
cp
-a /usr/lib/python2.7/site-packages/* /usr/lib/python2.7/dist-packages/
1
root@vm-6:~/scribe
# scribed -c examples/example1.conf
2
scribed: error
while
loading shared libraries: libthrift-0.9.0.so: cannot
open
shared object
file
: No such
file
or directory
3
4
ldd /usr/
local
/bin/scribed 发现
5
libthrift-0.9.0.so => not found
6
libthriftnb-0.9.0.so => not found
7
在/usr/
local
/lib/中都已经有该so文件,因为是环境变量有问题
8
9
export
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/
local
/lib
0 0
- 日志收集系统 scribe on centos 安装
- Scribe+HDFS日志收集系统安装方法
- Scribe+HDFS日志收集系统安装方法
- Scribe+HDFS日志收集系统安装方法
- Scribe+HDFS日志收集系统安装方法
- Scribe+HDFS日志收集系统安装方法
- Scribe + HDFS日志收集系统安装方法
- scribe日志收集系统
- scribe日志收集系统
- Scribe日志收集系统
- Scribe日志收集系统介绍
- scribe日志系统安装笔记
- scribe日志系统安装笔记
- 分布式日志收集系统:Facebook Scribe
- 分布式日志收集系统:Facebook Scribe
- 分布式日志收集系统: Facebook Scribe之日志收集方案
- scribe 收集汇总日志
- scribe日志收集
- C# DataTable的详细用法
- BCGControlbar生成Ribbon界面在主按钮显示FILE的解决方法。
- APK混淆及proguard混淆错误解决
- hadoop-2.2.0 分布式安装
- Gerrit审核服务器搭建简易教程(Ubuntu 12.10)
- 日志收集系统 scribe on centos 安装
- 取值函数getXX()、赋值函数setXX()的用法
- 【Leetcode】Sum Root to Leaf Numbers
- [初入职场] 不成文的期望
- camera isp
- Inside of Stagefright
- PHP集成支付宝快速实现充值功能
- HBase建表的同时建分区
- vijos 1071 新年趣事之打牌