yuanqiao 发表于 2015-11-28 16:23:00

云计算实战 (海量日志管理)hadoop + scribe -- scribe 介绍和安装

  scribe 介绍:
  
  scribe 是facebook 开源的分布式日志系统 。 可以用java 借助log4j 向分布式scribe 写入日志。
  
安装环境: centos5.2

所需软件:



安装过程:
一、输入gcc –v 检查gcc版本是否>3.3.5
       是,则继续下一步。否,则安装gcc 。
二、安装ruby 和python
python 用默认安装路径。Ruby 推荐使用默认路径
    安装过程均为./configuremakemake install
三、安装lievent   
解压安装即可
       安装过程为./configuremakemake install
四、安装 boost   
解压安装即可(不可改路径)
       安装过程为./configuremakemake install(安装用时较长)
五、安装 php 和libxml2
先安装libxml2 (php依赖它) 在安装php(默认安装路径)
       安装过程均为./configuremakemake install
六、安装facebook 服务-- thrift 和 fb303
       首先解压并进入thrift 目录      
./bootstrap.sh
./configure –with-boost=/usr/local/include/boost/ -- with-php-config=/phppath /bin/php-config
make
make install   
thrift 安装完毕。
在当前目录 cd 到contrib/fb303/ :
./bootstrap.sh
./configure –with-boost=/usr/local/include/boost/
make
make install
fb303安装完毕。
七、安装scribe
       ./bootstrap
./configure –with-boost=/usr/local/include/boost/
make
make install

安装完毕。

配置环境变量 :
BOOST_ROOT=/usr/local/include/boost/
LD_LIBRARY_PATH=/usr/local/include/boost/lib::/usr/lob:/usr/local/lib
测试:
       /usr/local/bin/scribed/examples/example1.conf

   回车会出现:
    "STATUS: STARTING"

Java代码

[*]31 23:37:38 2010] "STATUS: configuring"   
[*]31 23:37:38 2010] "got configuration data from file </home/setups/scribe/scribe/examples/example1.conf>"   
[*]31 23:37:38 2010] "CATEGORY : default"   
[*]31 23:37:38 2010] "Creating default store"   
[*]31 23:37:38 2010] "configured <1> stores"   
[*]31 23:37:38 2010] "STATUS: "   
[*]31 23:37:38 2010] "STATUS: ALIVE"   
[*]31 23:37:38 2010] "Starting scribe server on port 1463"   
[*]Thrift: Sun Oct 31 23:37:38 2010 libevent 2.0.7-rc method epoll

"STATUS: configuring"
"got configuration data from file </home/setups/scribe/scribe/examples/example1.conf>"
"CATEGORY : default"
"Creating default store"
"configured <1> stores"
"STATUS: "
"STATUS: ALIVE"
"Starting scribe server on port 1463"
Thrift: Sun Oct 31 23:37:38 2010 libevent 2.0.7-rc method epoll
  
okayscribe 服务已启动。 (这个不只是测试,也是启动scribe 服务的方式。)
补充:
关于scribe 的安装 在下载目录下有个有个readme 写的很详细(可能没我写的实用^^)
scribe的启动和集群测试,均在examples 目录下的redme 上 写得相当详细。
如果大家在集群上有疑问,可交流^^

转载 http://www.javaeye.com/topic/796858
页: [1]
查看完整版本: 云计算实战 (海量日志管理)hadoop + scribe -- scribe 介绍和安装