1、在flume目录中创建flume-kafka-tail-conf.properties文件
# The configuration file needs to define the sources, # the channels and the sinks. # Sources, channels and sinks are defined per agent, # in this case called 'agent' a2.sources = r2 a2.channels = c2
a2.sinks = k2 ### define sources a2.sources.r2.type = exec
a2.sources.r2.command = tail -F /opt/datas/spark_word_count.log a2.sources.r2.shell = /bin/bash -c ### define channels a2.channels.c2.type = memory
a2.channels.c2.capacity = 1000 a2.channels.c2.transactionCapacity = 100 ### define sinks a2.sinks.k2.type = org.apache.flume.sink.kafka.KafkaSink a2.sinks.k2.brokerList = bigdata.eclipse.com:9092 a2.sinks.k2.topic = kafka_topic ### bind the sources and sinks to the channels a2.sources.r2.channels=c2
a2.sinks.k2.channel = c2
-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
2、测试
-. -- -- .. --- -- -- -. -- -- .. --. --- .. -- --. -- .. -- ---
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30604784/viewspace-2140736/
,如需转载,请注明出处,否则将追究法律责任。