flume配置文件与启动

客户端配置文件

a1.channels = ch1
a1.sources = exec-source1
a1.sinks = hdfs-sink1

a1.channels.ch1.type = memory
a1.channels.ch1.capacity = 1000
a1.channels.ch1.transactionCapacity = 1000
a1.channels.ch1.keep-alive = 30

a1.sources.exec-source1.type = exec
a1.sources.exec-source1.shell = /bin/bash -c
a1.sources.exec-source1.command = tail -n +0 -F     后跟要监控的日志文件路径

a1.sources.exec-source1.channels = ch1
a1.sources.exec-source1.threads = 5
a1.sources.exec-source1.restartThrottle = 100000
a1.sources.exec-source1.restart = true
a1.sources.exec-source1.logStdErr = true

a1.sinks.hdfs-sink1.channel = ch1
a1.sinks.hdfs-sink1.type = avro
a1.sinks.hdfs-sink1.hostname = 192.168.1.2
a1.sinks.hdfs-sink1.port = 3014

启动方式(客户端与服务端相同)

# bin/flume-ng agent -c conf/ -f conf/test.conf(配置文件名称) -n a1 -Dflume.root.logger=INFO,console
 

服务端配置文件内容

a1.channels = ch1 ch2
a1.sources = r1
a1.sinks = s1 s2

a1.channels.ch1.type = memory
a1.channels.ch1.capacity = 10000
a1.channels.ch1.transactionCapacity = 10000
a1.channels.ch1.keep-alive = 60


a1.channels.ch2.type = memory
a1.channels.ch2.capacity = 10000
a1.channels.ch2.transactionCapacity = 10000
a1.channels.ch2.keep-alive = 60


a1.sources.r1.type = avro
a1.sources.r1.bind = 192.168.1.2
a1.sources.r1.port = 3014
a1.sources.r1.channels = ch1  ch2
a1.sources.r1.threads = 5
a1.sources.r1.selector.type = replicating

a1.sinks.s1.channel = ch1
a1.sinks.s1.type = avro
a1.sinks.s1.hostname = 192.168.1.3
a1.sinks.s1.port = 3014


a1.sinks.s2.channel = ch2
a1.sinks.s2.type = avro
a1.sinks.s2.hostname = 192.168.1.3
a1.sinks.s2.port = 3114

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值