flume中conf的配置

监视文件夹
启动命令:
bin/flume-ng agent -c ./conf -f ./conf/spool-hdfs.conf -n a1 -Dflume.root.logger=INFO,console

测试: 往/home/hadoop/flumeSpool放文件(mv ././xxxFile /home/hadoop/flumeSpool),但是不要在里面生成文件

配置

a1.sources = r1
a1.sinks = k1
a1.channels = c1

##注意:不能往监控目中重复丢同名文件
a1.sources.r1.type = spooldir (cdh) /exec(cdh) /taildir(apache1.7版本之后,监控文件和目录,断点续查)
a1.sources.r1.spoolDir = /root/logs2 //监控的文件夹
a1.sources.r1.fileHeader = true

a1.sinks.k1.type = hdfs
a1.sinks.k1.channel = c1
a1.sinks.k1.hdfs.path = /flume/events/%y-%m-%d/%H%M/ //上传hdfs的路径
a1.sinks.k1.hdfs.filePrefix = events- //加个前缀
a1.sinks.k1.hdfs.round = true //是符开启时间上的舍弃
a1.sinks.k1.hdfs.roundValue = 10 //10分钟数据滚动,10分钟创建一个文件夹
a1.sinks.k1.hdfs.roundUnit = minute
a1.sinks.k1.hdfs.rollInterval = 0 //以间隔时间滚动
a1.sinks.k1.hdfs.rollSize = 134217728 //以文件大小滚动 byte
a1.sinks.k1.hdfs.rollCount = 0 //以event的个数滚动
a1.sinks.k1.hdfs.idleTimeout= 0 //超时时间设置
a1.sinks.k1.hdfs.batchSize = 1 //1批次写几个
a1.sinks.k1.hdfs.useLocalTimeStamp = true //开启本地时间戳功能
#生成的文件类型,默认是Sequencefile,可用DataStream,则为普通文本
a1.sinks.k1.hdfs.fileType = DataStream

a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100

a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1

apache flume1.7以后的配置

在这里插入图片描述

Flume的load balance图解及解决方法

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值