flume ng简单例子
来源:互联网 发布:二少捏脸数据 编辑:程序博客网 时间:2024/06/06 13:19
本例子来源于flume官方文档,主要演示部署flume agent单节点,接收信息然后控制台输出。
首先编辑配置文件,在conf目录中新建文件example.conf,然后添加以下内容:
# example.conf: A single-node Flume configuration# Name the components on this agenta1.sources = r1a1.sinks = k1a1.channels = c1# Describe/configure the sourcea1.sources.r1.type = netcata1.sources.r1.bind = localhosta1.sources.r1.port = 44444# Describe the sinka1.sinks.k1.type = logger# Use a channel which buffers events in memorya1.channels.c1.type = memorya1.channels.c1.capacity = 1000a1.channels.c1.transactionCapacity = 100# Bind the source and sink to the channela1.sources.r1.channels = c1a1.sinks.k1.channel = c1
然后启动:
bin/flume-ng agent --conf conf --conf-file conf/example.conf --name a1 -Dflume.root.logger=INFO,console
最后打开另外一个终端,执行命令:
uanggang@huanggangdeMacBook-Pro:~/workspace/dafka-project$ telnet localhost 44444Trying ::1...telnet: connect to address ::1: Connection refusedTrying 127.0.0.1...Connected to localhost.Escape character is '^]'.hello worldOK
在之前启动flume agent的终端上就会显示刚才输出的内容:
2015-11-18 10:31:17,101 (SinkRunner-PollingRunner-DefaultSinkProcessor) [INFO - org.apache.flume.sink.LoggerSink.process(LoggerSink.java:94)] Event: { headers:{} body: 68 65 6C 6C 6F 20 77 6F 72 6C 64 0D hello world. }2015-11-18 10:38:03,428 (SinkRunner-PollingRunner-DefaultSinkProcessor) [INFO - org.apache.flume.sink.LoggerSink.process(LoggerSink.java:94)] Event: { headers:{} body: 0D . }
0 0
- flume ng简单例子
- Flume-ng 例子
- Flume NG 例子
- flume-ng安装,应用,几个简单测试例子!
- flume-ng简单介绍
- flume-ng的简单使用
- flume-ng 实际应用例子,flume采集log4j日志
- Flume-NG 日志文件收集 简单实例
- flume-ng
- Flume NG
- flume ng
- Flume-ng
- Flume OG & Flume NG
- flume-ng的channe配置type=file例子
- Flume-NG指令集和第一个简单的案例
- flume OG VS flume NG
- FLume NG 开发环境
- Flume NG configuration sample
- 大量数据情况下单线程插入和多线程insert数据库的性能测试
- 信息加密技术的分类
- 文档地址
- iOS9 Storyboard unwind segue反回传递事件时机详细步骤
- Oracle查询重复数据并删除,只保留一条记录
- flume ng简单例子
- 关于百度地图ios8死机bug问题
- CocoaPods安装和更新命令
- (JavaSE)基础内容复习
- 混合欧拉图
- ubuntu的which、whereis、locate和find命令
- linux 下小技巧之-统计文件夹下面子文件夹下面的个数
- PBXcp error修复-No such file or directory
- poj 1068