flume配置详解

#名为agent 别名为a1,agent的source为r1,sinks的k2是hdfs k3是hbase,channels是c1
a1.sources = r1
a1.sinks = k1 k3
a1.channels = c1

a1.sources.r1.type = TAILDIR#监听文件类型
a1.sources.r1.filegroups = f1#文件的组别名为f1
a1.sources.r1.filegroups.f1 = /root/1.log/#f1所在地
a1.sources.r1.headers.f1.headerKey1 = value1 #标题键,当将绝对路径文件名附加到事件标题时使用
a1.sources.r1.fileHeader = true #文件头打开
a1.sources.ri.maxBatchCount = 1000#最大处理数
a1.sources.r1.interceptors = i1#拦截器别名
a1.sources.r1.interceptors.i1.type = timestamp#拦截器类型

a1.sinks.k1.type = hdfs#输出格式类型为hdfs
a1.sinks.k1.hdfs.path = /flume/events/%Y-%m-%d#输出文件在hdfs上的flume/events的年月日为名称的文件
a1.sinks.k1.hdfs.filePrefix = events-#文件前缀名
a1.sinks.k1.hdfs.round = true#是否应该将时间戳四舍五入(如果为真,则影响基于时间的转义序列,%t除外)
a1.sinks.k1.hdfs.roundValue = 10#四舍五入到该值的最高倍数(在使用hdfs.roundUnit配置的单元中),小于当前时间。
a1.sinks.k1.hdfs.roundUnit = minute#四舍五入到该值的最高倍数(在使用hdfs.roundUnit配置的单元中),小于当前时间。

a1.sinks.k3.type = hbase
a1.sinks.k3.table = qyy#表名
a1.sinks.k3.columnFamily = info#列簇名
a1.sinks.k3.zookeeperQuorum = 192.168.1.137:2181#zkip地址
a1.sinks.k3.serializer = org.apache.flume.sink.hbase.RegexHbaseEventSerializer#正则表达式序列
a1.sinks.k3.serializer.colNames = ROW_KEY,id,msg#列名称以rowkey,id,msg三个字段
a1.sinks.k3.serializer.regex = (.),(.),(.*)#切割为三个字段的正则表达式
a1.sinks.k3.serializer.rowKeyIndex = 0#必须写上以0为下角标的rowkey

#这个没成功
#a1.sinks.k2.type = hive #指定hive类型
#a1.sinks.k2.hive.metastore = thrift://127.0.0.1:9083#元数据所在地
#a1.sinks.k2.hive.database = default#库名
#a1.sinks.k2.hive.table = nnn#表名

a1.channels.c1.type = memory#指定channels为 内存类型
a1.channels.c1.capacity = 10000#内存容量为10000 越大越好 在成产过程中 如果过小会oom
a1.channels.c1.transactionCapacity = 1000 #物理容量 不得大于内存容量

a1.sources.r1.channels = c1#sources连接channels 只需要一个source就可以…
a1.sinks.k1.channel =c1#sink k1与channel的连接 注意不是channels!! 没有s
a1.sinks.k3.channel = c1#sin k3与channel的连接 注意不是channels!! 没有s

发布了124 篇原创文章 · 获赞 0 · 访问量 7884

猜你喜欢

转载自blog.csdn.net/weixin_43680708/article/details/88320513