flume安装目录的conf下
配置文件如下:
# define
#比如我们有8个路径要收集
a1.sources = r1 r2 r3 r4 r5 r6 r7 r8
a1.sinks = k6
a1.channels = c6
# source
a1.sources.r1.type = exec
a1.sources.r2.type = exec
a1.sources.r3.type = exec
a1.sources.r4.type = exec
a1.sources.r5.type = exec
a1.sources.r6.type = exec
a1.sources.r7.type = exec
a1.sources.r8.type = exec
a1.sources.r1.command = tail -F -c +0 /logs/bbcc-bs-1/baseBusiness.log
a1.sources.r2.command = tail -F -c +0 /logs/bbcc-bs-2/baseBusiness.log
a1.sources.r3.command = tail -F -c +0 /logs/bbcc-bs-3/baseBusiness.log
a1.sources.r4.command = tail -F -c +0 /logs/bbcc-bs-4/baseBusiness.log
a1.sources.r5.command = tail -F -c +0 /logs/bbcc-bs-5/baseBusiness.log
a1.sources.r6.command = tail -F -c +0 /logs/bbcc-bs-6/baseBusiness.log
a1.sources.r7.command = tail -F -c +0 /logs/bbcc-bs-7/baseBusiness.log
a1.sources.r8.command = tail -F -c +0 /logs/bbcc-bs-8/baseBusiness.log
a1.sources.r1.shell = /bin/bash -c
a1.sources.r2.shell = /bin/bash -c
a1.sources.r3.shell = /bin/bash -c
a1.sources.r4.shell = /bin/bash -c
a1.sources.r5.shell = /bin/bash -c
a1.sources.r6.shell = /bin/bash -c
a1.sources.r7.shell = /bin/bash -c
a1.sources.r8.shell = /bin/bash -c
# sink
a1.sinks.k6.type = org.apache.flume.sink.kafka.KafkaSink
a1.sinks.k6.kafka.bootstrap.servers = ip(服务器对应的ip):9092,ip(服务器对应的ip):9092,ip(服务器对应的ip):9092
a1.sinks.k6.kafka.topic = produupie
a1.sinks.k6.kafka.flumeBatchSize = 20
a1.sinks.k6.kafka.producer.acks = 1
a1.sinks.k6.kafka.producer.linger.ms = 1
# channel
a1.channels.c6.type = memory
a1.channels.c6.capacity = 10000
a1.channels.c6.transactionCapacity = 100
# bind
a1.sources.r1.channels = c6
a1.sources.r2.channels = c6
a1.sources.r3.channels = c6
a1.sources.r4.channels = c6
a1.sources.r5.channels = c6
a1.sources.r6.channels = c6
a1.sources.r7.channels = c6
a1.sources.r8.channels = c6
a1.sinks.k6.channel = c6
我们可以考虑到sources路径配置到一起,希望这个配置对你有所帮助