设为首页 加入收藏

TOP

将Kafka作为Flume的Source
2019-02-17 14:31:10 】 浏览:103
Tags:Kafka 作为 Flume Source

1. 配置flume

kafka-source.properties

agent1.sources = source1  
agent1.channels = channel1  
agent1.sinks = sink1  
  
agent1.sources.source1.type = org.apache.flume.source.kafka.KafkaSource
agent1.sources.source1.batchSize = 5000
agent1.sources.source1.batchDurationMillis = 2000
agent1.sources.source1.kafka.bootstrap.servers = centos1:9092
agent1.sources.source1.kafka.topics = mytopic
agent1.sources.source1.kafka.consumer.group.id = group1
  
agent1.sinks.sink1.type=logger  
  
agent1.channels.channel1.type=memory  
agent1.channels.channel1.capacity=1000  
agent1.channels.channel1.transactionCapacity=100  
  
agent1.sources.source1.channels=channel1  
agent1.sinks.sink1.channel=channel1  

2. 启动flume

flume-ng agent -n agent1 -c conf -f conf/kafka-source.properties -Dflume.root.logger=INFO,console

3.启动Kafka producer

kafka-console-producer.sh --broker-list centos1:9092 --topic mytopic

参考

http://flume.apache.org/FlumeUserGuide.html

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Error while fetching metadata w.. 下一篇kafka->logstash->es

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目