安装ubuntu10.04 下 安装 scribe thrift
来源:互联网 发布:日本的电视直播软件 编辑:程序博客网 时间:2024/04/29 03:03
scribe就不用介绍了,网上很多资料,下面文档很方便ubuntu+scribe安装,希望对大家有帮助。scribe只负责接收消息,日志分析程序还需要自己写。
1.安装依赖包
apt-get install ruby-dev libevent-dev python-dev libevent-dev\ libboost-dev libboost-filesystem-dev collectd-dev bison flex\ automake autoconf ant libssl-dev git-core
另外还需安装 libtool 工具 不然安装 scribe会出错
2.编译安装thrift
http://thrift.apache.org/download/wget http://www.apache.org/dist/thrift/0.7.0/thrift-0.7.0.tar.gztar xvzf thrift-0.7.0.tar.gzcd thrift-0.7.0./configuremakemake installcd contrib/fb303./bootstrap.shmakemake installvi /etc/ld.so.conf#增加下面一行/usr/local/lib执行:ldconfig
3.安装scribe
git clone http://github.com/facebook/scribe.gitcd scribe./bootstrap.shmakemake install
4.配置scribe
使用默认配置文件,在scribe源目录下
cd scribe/examples
5.scribe管理
cd scribe/examples启动scribed example1.conf停止scribe./scribe_ctrl stop查看状态./scribe_ctrl status统计./scribe_ctrl counters
7.测试
ubuntu下python的库文件需要移动到新目录,才能用
mv /usr/lib/python2.6/site-packages/* /usr/lib/python2.6/dist-packages/cd scribe/examplesecho "11"|./scribe_cat testcat /tmp/scribetest/test/test_current输出11,说明OK
注:
服务器端需要以上7个步骤,也就是集中管理日志的那台服务器
客户端,只需要安装thrift即可,必装
thrift 安装
thrift目录
find thrift/ -name "*.thrift"
find scribe/ -name "*.thrift"
请找到fb303.thrift和scribe.thift,放到相同的目录下,修改scribe.thrift中包含fb303的路径为当前路径。然后执行
#thrift -r --gen php scribe.thrift
会在当前目录下生成gen-php的文件夹,你所需要的php框架文件都在这个文件夹下。再 在 thrift目录 cp -R thrift-0.8.0/lib/php/src/* 下所有文件拷贝到gen-php目录下即可组成所需框架
如果你需要生成c++,java,python,ruby甚至erlang, haskball,就将命令行中的php替换为这些单词。
测试 gen-php目录 重命名为 thrift目录
新建一个php文件
<?php
$GLOBALS['THRIFT_ROOT'] = './thrift';
include_once $GLOBALS['THRIFT_ROOT'] . '/scribe/scribe.php';
include_once $GLOBALS['THRIFT_ROOT'] . '/transport/TSocket.php';
include_once $GLOBALS['THRIFT_ROOT'] . '/transport/TFramedTransport.php';
include_once $GLOBALS['THRIFT_ROOT'] . '/protocol/TBinaryProtocol.php';
$msg1['category'] = 'Test';
$msg1['message'] = "a,b,c,d,e,f,g";
$entry1 = new LogEntry($msg1);
$messages = array($entry1);
$socket = new TSocket('localhost', 1463, true);
$transport = new TFramedTransport($socket);
$protocol = new TBinaryProtocol($transport, false, false);
$scribe_client = new scribeClient($protocol, $protocol);
$transport->open();
$scribe_client->Log($messages);
$transport->close();
?>
完成!
原文地址 http://www.gaojinbo.com/ubuntu%E4%B8%8B%E5%AE%89%E8%A3%85scribe.html
- 安装ubuntu10.04 下 安装 scribe thrift
- thrift+scribe安装+hadoop
- 在linux(CentOS)上安装Thrift+Scribe
- scribe安装
- Scribe安装
- ubuntu13.04下thrift安装
- Ubuntu10.04下安装JDK6
- Ubuntu10.04下安装uClinux
- Ubuntu10.04下安装JDK6
- ubuntu10.04下安装LAMP
- UBUNTU10.04 下安装 lamp
- ubuntu10.04下安装LAMP
- ubuntu10.04下安装oracle10g
- ubuntu10.04下安装qq
- ubuntu10.04下安装jdk
- ubuntu10.04下安装jdk
- Ubuntu10.04下安装SQLite3
- ubuntu10.04下安装nginx
- Jqplot+asp.net画图实现
- WinCE6.0 Platform Builder有试用时间限制,使用此方法破解限制。
- 斯特林数 [Stirling Numbers]
- 动态创建CListCtrl代码
- Php连接Cassandra慢问题解决方案(Using Cassandra with PHP)
- 安装ubuntu10.04 下 安装 scribe thrift
- std::find ,set.find, multiset.find, map.find和multimap.find算法总结
- 课堂笔记
- 动态创建的CListCtrl控件的消息响应
- linux输入子系统(设备驱动与事件驱动)
- 怎么建立socket长连接???
- Tomcat 6.0 错误信息: 严重: StandardServer.await:create[8005]: java.net.BindException: Address already in u
- arcgis api for flex 两种鹰眼的实现方法
- Linux下的多线程编程