flume配置文件

1.Sink-ES

#------agent-----
agent.sources=agentSource
agent.channels=agentChannel
agent.sinks=agentSink

#-------- agentSource-----------
agent.sources.agentSource.type=org.apache.flume.source.kafka.KafkaSource
agent.sources.agentSource.zookeeperConnect=IP:2181
agent.sources.agentSource.topic=TopicName
agent.sources.agentSource.groupId=Flume
agent.sources.agentSource.batchSize=1000
agent.sources.agentSource.kafka.consumer.timeout.ms=3000

#------- agentChannel-----------
agent.channels.agentChannel.type=file
agent.channels.agentChannel.checkpointDir=/mnt/data/flume/checkpoint
agent.channels.agentChannel.dataDirs=/mnt/data/flume
agent.channels.agentChannel.capacity=100000
agent.channels.agentChannel.transactionCapacity= 1000
agent.channels.agentChannel.keep-alive=100
agent.sources.agentSource.channels=agentChannel
agent.sinks.agentSink.channel=agentChannel

#---------agentSink ------------
agent.sinks.agentSink.type=elasticsearch
agent.sinks.agentSink.hostNames=hostIp:12300
agent.sinks.agentSink.clusterName=es
agent.sinks.agentSink.indexName=indexName
agent.sinks.agentSink.indexType=indexType
agent.sinks.agentSink.idName=ID
agent.sinks.agentSink.batchSize=1000

 

2.Sink-HBase

#------agent-----
agent.sources=agentSource
agent.channels=agentChannel
agent.sinks=agentSink

#-------- agentSource-----------
agent.sources.agentSource.type=org.apache.flume.source.kafka.KafkaSource
agent.sources.agentSource.zookeeperConnect=IP:2181
agent.sources.agentSource.topic=TopicName
agent.sources.agentSource.groupId=Flume
agent.sources.agentSource.batchSize=1000
agent.sources.agentSource.kafka.consumer.timeout.ms=3000

#------- agentChannel-----------
agent.channels.agentChannel.type=file
agent.channels.agentChannel.checkpointDir=/mnt/data/flume/checkpoint
agent.channels.agentChannel.dataDirs=/mnt/data/flume
agent.channels.agentChannel.capacity=100000
agent.channels.agentChannel.transactionCapacity= 1000
agent.channels.agentChannel.keep-alive=100
agent.sources.agentSource.channels=agentChannel
agent.sinks.agentSink.channel=agentChannel

#---------agentSink-------------------
agent.sinks.agentSink.type=hbase
agent.sinks.agentSink.zookeeperQuorum=ip:2181
agent.sinks.agentSink.table=tableName
agent.sinks.agentSink.tableType=table
agent.sinks.agentSink.columnFamily=d
agent.sinks.agentSink.serializer=org.apache.flume.sink.hbase.RegexHbaseEventSerializer
agent.sinks.agentSink.serializer.colNames=RowKey
agent.sinks.agentSink.serializer.rowKeyIndex=0
agent.sinks.agentSink.batchSize=1000

3.Sink-HDFS

#------agent-----
agent.sources=agentSource
agent.channels=agentChannel
agent.sinks=agentSink

#-------- agentSource-----------
agent.sources.agentSource.type=org.apache.flume.source.kafka.KafkaSource
agent.sources.agentSource.zookeeperConnect=IP:2181
agent.sources.agentSource.topic=TopicName
agent.sources.agentSource.groupId=Flume
agent.sources.agentSource.batchSize=1000
agent.sources.agentSource.kafka.consumer.timeout.ms=3000

#------- agentChannel-----------
agent.channels.agentChannel.type=file
agent.channels.agentChannel.checkpointDir=/mnt/data/flume/checkpoint
agent.channels.agentChannel.dataDirs=/mnt/data/flume
agent.channels.agentChannel.capacity=100000
agent.channels.agentChannel.transactionCapacity= 1000
agent.channels.agentChannel.keep-alive=100
agent.sources.agentSource.channels=agentChannel
agent.sinks.agentSink.channel=agentChannel

#---------agentSink------------------
agent.sinks.agentSink.type=hdfs
agent.sinks.agentSink.hdfs.path =/data/flume/partitionday=%Y%m%d/partitionhour=%Y%m%d%H
agent.sinks.agentSink.hdfs.filePrefix=fileName_%Y%m%d%H
agent.sinks.agentSink.hdfs.timeZone=Asia/Shanghai
agent.sinks.agentSink.hdfs.fileType=DataStream
agent.sinks.agentSink.hdfs.batchSize=1000
agent.sinks.agentSink.hdfs.rollCount=0
agent.sinks.agentSink.hdfs.rollInterval=600
agent.sinks.agentSink.hdfs.rollSize=134217728
agent.sinks.agentSink.hdfs.callTimeout=7200000

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值