flume 学习三:各种执行案例
来源:互联网 发布:最新网络诈骗三手段 编辑:程序博客网 时间:2024/06/06 00:06
说明:
-c目录,-f 具体文件,文件名 ,-n 代理名称,以下两个命令等同,一个是简写
bin/flume-ng agent --conf ./conf --conf-file ./conf/example.conf --name a1 -Dflume.root.logger=INFO,console
bin/flume-ng agent -c ./conf -f ./conf/example.conf -n a1 -Dflume.root.logger=INFO,console
1.案例一:exesource
在example2.conf设置如下:
a1.sources = r1
a1.sinks = k1
a1.channels = c1
# Describe/configure the source
a1.sources.r1.type = exec
a1.sources.r1.command = echo 'hello'
# Describe the sink
a1.sinks.k1.type = logger
# Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100
# Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
执行结果:bin/flume-ng agent -c ./conf -f ./conf/example2.conf -n a1 -Dflume.root.logger=INFO,console (第二张是第一张执行后显示的结果)
2.案例二:netcatsource
example.conf配置文件的内容:
# example.conf: A single-node Flume configuration
# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1
#Describe/configure the source
a1.sources.r1.type = netcat
a1.sources.r1.bind = localhost
a1.sources.r1.port = 44444
#Describe the sink
a1.sinks.k1.type = logger
# Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 100000
a1.channels.c1.transactionCapacity = 1000
# Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
2.执行命令:在第一个窗口输入 :[jurf@ljf-centos apache-flume-1.6.0-bin]$ bin/flume-ng agent -c ./conf -f ./conf/example.conf -n a1 -Dflume.root.logger=INFO,console
在第二个窗口输入:telnet localhost 44444;(之后输入要传输的的内容)
3. 如图:
有两个问题:1.为何不能显示汉字;2.为何显示的文字不能超过16位的长度。待研究.........
退出telnet命令:ctrl + ] 回车
之后: quit
详细文档见百度网盘
- flume 学习三:各种执行案例
- flume 学习四:各种执行案例二
- Flume-应用案例(三)
- flume学习(三)
- flume 案例
- Flume案例
- 案例三:执行 JavaScript 语句
- flume学习(三):Flume Interceptors的使用
- flume学习(三):Flume Interceptors的使用
- flume学习(三):Flume Interceptors的使用
- Unity3D 学习案例三
- flume-02-flume案例集锦
- Flume学习笔记之初识(三)
- Flume学习8_Flume1.5.0入门:安装、部署、及flume的案例
- Flume 的使用案例
- flume + hdfs 案例
- flume案例集锦
- Flume hdfs 案例
- [AFNetworking练习3]监测网络链接状态
- 2016年香港台湾开源镜像站点汇总
- Java中的泛型方法
- KVC 与 KVO 全面总结
- SAP提供了一个标准的报表查看修改记录: RSSCD100
- flume 学习三:各种执行案例
- 关于IIS发布服务器访问数据服务器配置虚拟目录问题
- 下拉刷新--加载更多
- java事务 深入Java事务的原理与应用
- android开发环境
- 打印预览:print
- Android基础--调用系统相机,打开相册,展示到界面,出现的一些问题Uri为空,data为null,图片错乱问题
- CALayer中自定义属性的动画
- RESTful API 设计指南