Flume:TailDir实战

#source的名字
agent.sources = s1
# channels的名字
agent.channels = c1
# sink的名字
# 指定source使用的channel
agent.sources.s1.channels = c1
# 指定sink使用的channel
# source的名字
agent.sources = s1
# channels的名字
agent.channels = c1
# sink的名字
agent.sinks = r1

# 指定source使用的channel
agent.sources.s1.channels = c1
# 指定sink使用的channel
agent.sinks.r1.channel = c1

######## source相关配置 ########
# source类型
agent.sources.s1.type = TAILDIR
# 元数据位置
agent.sources.s1.positionFile =/usr/local/flume-1.9.0/posifile/taildir_position.json
# 监控的目录
agent.sources.s1.filegroups = f1
agent.sources.s1.filegroups.f1=/usr/elk/logs/open-api/sop-gateway-common/.*log
agent.sources.s1.fileHeader = true

######## channel相关配置 ########
# channel类型
agent.channels.c1.type = file 
# 数据存放路径
agent.channels.c1.dataDirs = /usr/local/flume-1.9.0/flumedata
# 检查点路径
agent.channels.c1.checkpointDir=/usr/local/flume-1.9.0/checkpoint/
# channel中最多缓存多少
agent.channels.c1.capacity = 1000
# channel一次最多吐给sink多少
agent.channels.c1.transactionCapacity = 500

######## sink相关配置 ########
# sink类型
agent.sinks.r1.type = org.apache.flume.sink.kafka.KafkaSink
# brokers地址
agent.sinks.r1.kafka.bootstrap.servers = 2:9092,3:9092,4:9092
# topic
agent.sinks.r1.kafka.topic = openapi-logInterface
agent.sinks.r1.requiredAcks=1
agent.sources.s1.inputCharset=utf-8
# 压缩
agent.sinks.r1.kafka.producer.compression.type = snappy

猜你喜欢

转载自blog.csdn.net/qq_34635236/article/details/106257657