配置文件有误,修改配置文件

# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1

#define a memory channel called c1 on a1
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100
#Describe/configure the source
a1.sources.r1.channels = c1
a1.sources.r1.type = exec
a1.sources.r1.command = tail -f /opt/flume-1.9.0/log

#Describe the sink
a1.channels.channel1.type = org.apache.flume.channel.kafka.KafkaChannel
a1.channels.channel1.kafka.bootstrap.servers = hadoop102:9092,hadoop103:9092,hadoop104:9092
a1.channels.channel1.kafka.topic = test
a1.channels.channel1.kafka.consumer.group.id = flume-consumer

修改flume启动命令:

flume-ng agent -n a1 -c conf -f conf/flume_kafka1.conf -Dflume.root.logger=INFO,console

修改kafka消费者启动命令:

kafka-console-consumer.sh --bootstrap-server hadoop102:9092 --from-beginning --topic test

 

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐