Flume收集数据到Kafka
1.启动Zookeeper, Kafka,参考上一篇文章,创建topic,启动Kafka消费者终端
2.修改Flume的配置文件
MyAgent.sinks.mysink.type = org.apache.flume.sink.kafka.KafkaSink
MyAgent.sinks.mysink.topic = test
MyAgent.sinks.mysink.brokerList = localhost:9092
MyAgent.sinks.mysink.requiredAcks = 1
MyAgent.sinks.mysink.batchSize = 20
3.启动Flume收集数据
阅读(1469) | 评论(0) | 转发(0) |