Fulme的几种监听配置信息
来源:互联网 发布:android java服务器端 编辑:程序博客网 时间:2024/05/21 06:43
针对不同的source 需要配置不同的配置文件,更为详细的配置内容 在flume官网
本文章只举例几个常用的监听配置文件。
-------------------------------------------------------------------------------------------------------
监听网络中的数据,将监听到底的数据输出值控制台
# flume-nc.conf: 用于监听网络数据的flume agent实例的配置文件
############################################
# 对各个组件的描述说明
# 其中a1为agent的名字
# r1是a1的source的代号名字
# c1是a1的channel的代号名字
# k1是a1的sink的代号名字
############################################
a1.sources = r1
a1.sinks = k1
a1.channels = c1
# 用于描述source的,类型是netcat网络
a1.sources.r1.type = netcat
# source监听的网络ip地址和端口号
a1.sources.r1.bind = master01
a1.sources.r1.port = 44444
# 用于描述sink,类型是日志格式
a1.sinks.k1.type = logger
# 用于描述channel,在内存中做数据的临时的存储
a1.channels.c1.type = memory
# 该内存中最大的存储容量,1000个events事件
a1.channels.c1.capacity = 1000
# 能够同时对100个events事件监管事务
a1.channels.c1.transactionCapacity = 100
# 将a1中的各个组件建立关联关系,将source和sink都指向了同一个channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
运行方式:
一:telnet
需要在centOS上面安装telnet,
启动flumn-agent
启动telnet:
telnet master01 44444
二:netcat
安装发给大家的nc.xx.rpm
rpm -ivh nc.xx.rpm-path
启动flumn-agent
启动nc进程
nc master01 44444
三:后台静默执行进程,使用nohup命令,同时要想让进程自动执行,需要在命令末尾加上&
----------------------------------------------------------------------------------------
# flume-nc.conf: 用于监听文件中的新增数据的flume agent实例的配置文件
############################################
# 对各个组件的描述说明
# 其中a1为agent的名字
# r1是a1的source的代号名字
# c1是a1的channel的代号名字
# k1是a1的sink的代号名字
############################################
a1.sources = r1
a1.sinks = k1
a1.channels = c1
# 用于描述source的,类型是linux命令
a1.sources.r1.type = exec
a1.sources.r1.command = tail -F /opt/logs/flume/nb-http.2017-07-24.log
# 用于描述sink,类型是日志格式
a1.sinks.k1.type = logger
# 用于描述channel,在内存中做数据的临时的存储
a1.channels.c1.type = memory
# 该内存中最大的存储容量,1000个events事件
a1.channels.c1.capacity = 1000
# 能够同时对100个events事件监管事务
a1.channels.c1.transactionCapacity = 100
# 将a1中的各个组件建立关联关系,将source和sink都指向了同一个channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
运行:flume]# bin/flume-ng agent --conf conf --name a1 --conf-file conf/flume-nc.conf -Dflume.root.logger=INFO,console
----------------------------------------------------------------------------------------
# flume-exec.conf: 用于监听文件中的新增数据的flume agent实例的配置文件
############################################
# 对各个组件的描述说明
# 其中a1为agent的名字
# r1是a1的source的代号名字
# c1是a1的channel的代号名字
# k1是a1的sink的代号名字
############################################
a1.sources = r1
a1.sinks = k1
a1.channels = c1
# 用于描述source的,类型是linux命令
a1.sources.r1.type = exec
a1.sources.r1.command = tail -F /opt/logs/flume/nb-http.2017-07-24.log
# 用于描述sink,类型是日志格式
a1.sinks.k1.type = logger
# 用于描述channel,在内存中做数据的临时的存储
a1.channels.c1.type = memory
# 该内存中最大的存储容量,1000个events事件
a1.channels.c1.capacity = 1000
# 能够同时对100个events事件监管事务
a1.channels.c1.transactionCapacity = 100
# 将a1中的各个组件建立关联关系,将source和sink都指向了同一个channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
运行:flume]# bin/flume-ng agent --conf conf --name a1 --conf-file conf/flume-exec.conf -Dflume.root.logger=INFO,console
tail -f和tail -F区别
一般查看一个文件使用tail -f足够,但是tail -f有一个问题,当有新的数据从监听文件中分割出去,便不再
查看到新增的内容,这个时候使用tail -F
当修改下面两个参数的时候,由于在channel中容纳的数据量过大,超过的内存的限制,造成OOM异常!
a1.channels.c1.capacity = 1000000
a1.channels.c1.transactionCapacity = 100
解决办法,调高当前application的jvm内存大小
bin/flume-ng agent JAVA_OPTS="-Xmx20m" --name a1 --conf conf --conf-file conf/flume-exec.properties -Dflume.root.logger=INFO,console
----------------------------------------------------------------------------------------
# flume-dir.conf: 用于监听目录中的新增文件的flume agent实例的配置文件
############################################
# 对各个组件的描述说明
# 其中a1为agent的名字
# r1是a1的source的代号名字
# c1是a1的channel的代号名字
# k1是a1的sink的代号名字
############################################
a1.sources = r1
a1.sinks = k1
a1.channels = c1
# 用于描述source的,监听的是一个目录
a1.sources.r1.type = spooldir
a1.sources.r1.spoolDir = /opt/logs/flume/
a1.sources.r1.fileSuffix = .OK
a1.sources.r1.deletePolicy = never
a1.sources.r1.fileHeader = true
# 用于描述sink,类型是日志格式
a1.sinks.k1.type = logger
# 用于描述channel,在内存中做数据的临时的存储
a1.channels.c1.type = memory
# 该内存中最大的存储容量,1000个events事件
a1.channels.c1.capacity = 1000
# 能够同时对100个events事件监管事务
a1.channels.c1.transactionCapacity = 100
# 将a1中的各个组件建立关联关系,将source和sink都指向了同一个channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
运行:flume]# bin/flume-ng agent --conf conf --name a1 --conf-file conf/flume-dir.conf -Dflume.root.logger=INFO,console
----------------------------------------------------------------------------------------
# flume-hdfs.conf: 用于监听目录中的新增文件传送到hdfs的flume agent实例的配置文件
############################################
# 对各个组件的描述说明
# 其中a1为agent的名字
# r1是a1的source的代号名字
# c1是a1的channel的代号名字
# k1是a1的sink的代号名字
############################################
a1.sources = r1
a1.sinks = k1
a1.channels = c1
# 用于描述source的,监听的是一个目录
a1.sources.r1.type = spooldir
a1.sources.r1.spoolDir = /opt/logs/flume/
a1.sources.r1.fileSuffix = .OK
a1.sources.r1.deletePolicy = never
a1.sources.r1.fileHeader = true
# 用于描述sink,类型是hdfs
a1.sinks.k1.type = hdfs
a1.sinks.k1.hdfs.path = hdfs://ns1/input/flume/%Y/%m/
a1.sinks.k1.hdfs.filePrefix = master-
a1.sinks.k1.hdfs.fileSuffix = .com
a1.sinks.k1.hdfs.round = true
a1.sinks.k1.hdfs.roundValue = 10
a1.sinks.k1.hdfs.roundUnit = second
a1.sinks.k1.hdfs.useLocalTimeStamp = true
# 用于描述channel,在内存中做数据的临时的存储
a1.channels.c1.type = memory
# 该内存中最大的存储容量,1000个events事件
a1.channels.c1.capacity = 1000
# 能够同时对100个events事件监管事务
a1.channels.c1.transactionCapacity = 100
# 将a1中的各个组件建立关联关系,将source和sink都指向了同一个channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
- Fulme的几种监听配置信息
- Spring监听配置的几种方式
- android的默认配置信息的几种方式
- BCB中保存配置信息的几种方法
- 电话通话几种状态的监听
- android Button 监听的几种方式
- ios监听的几种方法比较
- android Button 监听的几种方式
- android Button 监听的几种方式
- 监听事件的几种实现方式
- android Button 监听的几种方式
- 安卓中常见的几种监听事件
- android Button 监听的几种方式
- android Button 监听的几种方式
- android Button 监听的几种方式
- android Button 监听的几种方式
- 添加事件监听 的几种方法
- ListView 滑动监听的几种状态
- java十六进制转八进制蓝桥杯试题
- 让一个 caffe 跑起来的流程及注意事项
- drawlayout侧滑
- view
- kkk
- Fulme的几种监听配置信息
- 多线程详解
- meshlab调整平行光源
- 电商实例、业务并发、网站并发及解决办法
- Anaconda安装
- 苹果内购挖坑实录
- LevelDB源码分析之五:skiplist(1)
- 快查手册: Markdown
- 【转】利用Piranha+LVS方案实现WEB负载均衡