scribe 安装文档

环境:CentOS 5.6 64bit

一:安装必要的包
1. yum install autoconf automake libtool zlib libevent python boost erlang ruby boost-devel libevent-devel ruby-devel python-devel openssl-devel gcc gcc-c++
2.手动下载boost_1_42_0.tar.gz(scribe依赖1.36以上的版本) thrift-0.7.0.tar.gz facebook-scribe-63e4824.zip
二、安装boost_1_42_0
1.解压后执行 ./bootstrap.sh
2../bjam install  (时间可能有点长)
三、安装 thrift
1.解压
2.chmod +x configure
3.chmod +x lib/erl/rebar
4../configure –with-boost=/usr/local/include/boost
5.make 若是报“error while loading shared libraries: libboost_system.so.1.42.0: cannot open shared object file: No such file or     directory” 请执行“echo “/usr/local/lib” > /etc/ld.so.conf.d/usr_local_lib.conf ” 然后 ldconfig
6.make  install
7.安装 fb303(scribe 依赖此扩展,若没有 则在安装scribe 的时候会报错)
   在thrift的文件夹下有一个contrib/fb303 文件夹 cd contrib/fb303 chmod +x ./bootstrap.sh     ./bootstrap.sh  然后重复 4 5 6 步骤
四 安装scribe
1.设置环境变量:
     export BOOST_ROOT=/usr/local/include/boost/
     export LD_LIBRARY_PATH=/usr/local/boost/lib:/usr/lib/:/usr/local/lib
     ldconfig -v
2../bootstrap.sh
3.make
4.make install
5.为了测试scribe是否安装成功,在刚才的源码的文件夹下,进入example 文件夹,然后执行 scribed example1.conf  若没有报错则表示安装成功了。
6.可以在example文件夹下执行./scribe_ctrl status 查看scribe的状态
 

使用 scribe_ctrl 脚本 来管理 Scribe:(此命令依赖fb303)

scribe_ctrl {command} [ <port number> ]

scribe_ctrl commands: 
status – 当服务正常运行的时候,返回‘ALIVE ’ 。
version – 返回 Scribe Server 的版本
alive – 返回系统的运行时间,单位是秒。 
stop – 关闭scribe服务
reload – 重新加载配置文件
counters – 将会返回以下信息 (if non-zero):

  • received good :  scribe启动后收到的消息的数量
  • received bad :  scribe 启动后收到的非法的消息的数量
  • sent :  发送到其他的 Scribe Server的消息的数量
  • denied for queue size : 因为消息队列满了,而被拒绝的请求数量。
  • denied for rate : 因为访问频率限制而被拒绝的请求数量
  • retries :  Buffer Store 写日志信息时的重试次数
  • requeue : scribe 将消息写到store故障时的重试次数(前提是must_succeed必须启用)
  • lost : 丢失的消息的数量(推荐配置:使用 buffer store 可以避免丢失消息)
  • received blank category :  category为空的消息的数

7.server 启动后,开启另外一个终端向server发送消息:使用scribe_cat

  echo “hello world!!!!”|./scribe_cat test
  若是报错:importerror: No module named scribe 则可能是因为系统中存在多个python版本,那么,可以尝试着修改下scribe_cat  将此文件的第一行修改为 #/usr/bin/env python
原文地址:https://www.cnblogs.com/qgxiaoguang/p/2914455.html