大数据全系列 教程
1869个小节阅读:465.9k
目录
408考研
JAVA全系列 教程
面向对象的程序设计语言
Python全系列 教程
Python3.x版本,未来主流的版本
人工智能 教程
顺势而为,AI创新未来
大厂算法 教程
算法,程序员自我提升必经之路
C++ 教程
一门通用计算机编程语言
微服务 教程
目前业界流行的框架组合
web前端全系列 教程
通向WEB技术世界的钥匙
大数据全系列 教程
站在云端操控万千数据
AIGC全能工具班
A A
White Night
xxxxxxxxxx
[root@node3 ~]# cd /opt/flume-1.9.0/jobs/
[root@node3 jobs]# vim music_song.properties
具体内容如下:
xxxxxxxxxx
#设置source名称
b.sources = r1
#设置channel的名称
b.channels = c1
#设置sink的名称
b.sinks = k1
# For each one of the sources, the type is defined
#设置source类型为TAILDIR,监控目录下的文件
#Taildir Source可实时监控目录一批文件,并记录每个文件最新消费位置,agent进程重启后不会有重复消费的问题
b.sources.r1.type = TAILDIR
#文件的组,可以定义多种
b.sources.r1.filegroups = f1
#第一组监控的是test1文件夹中的什么文件:.log文件
b.sources.r1.filegroups.f1 = /var/music_logs/userplaysong/.*log
#第二组监控的是test2文件夹中的什么文件:以.txt结尾的文件
#b.sources.r1.filegroups.f2 = /var/music_logs/system/*.txt
#设置source中一行内容最大字节数
b.sources.r1.max-line-length = 1000000
# The channel can be defined as follows.
#设置source的channel名称
b.sources.r1.channels = c1
# Each channel's type is defined.
#设置channel的类型
b.channels.c1.type = memory
#设置channel道中最大可以存储的event数量
b.channels.c1.capacity = 1000
#每次最大从source获取或者发送到sink中的数据量
b.channels.c1.transcationCapacity=100
# Each sink's type must be defined
#设置Kafka接收器
b.sinks.k1.type = org.apache.flume.sink.kafka.KafkaSink
#设置Kafka的broker地址和端口号
b.sinks.k1.brokerList=node2:9092,node3:9092,node4:9092
#设置Kafka的Topic
b.sinks.k1.topic=songinfo
#Specify the channel the sink should use
#设置sink的channel名称
b.sinks.k1.channel = c1