首页 技术 正文
技术 2022年11月21日
0 收藏 510 点赞 3,196 浏览 2396 个字

1、官方网站也有配置:

https://flume.apache.org/FlumeUserGuide.html#kafka-source

2、clodera 官方配置

https://www.cloudera.com/documentation/kafka/2-0-x/topics/kafka_flume.html

1\

 tier1.sources  = source1
tier1.channels = channel1
tier1.sinks = sink1 tier1.sources.source1.type = org.apache.flume.source.kafka.KafkaSource
tier1.sources.source1.zookeeperConnect = zk01.example.com:
tier1.sources.source1.topic = weblogs
tier1.sources.source1.groupId = flume
tier1.sources.source1.channels = channel1
tier1.sources.source1.interceptors = i1
tier1.sources.source1.interceptors.i1.type = timestamp
tier1.sources.source1.kafka.consumer.timeout.ms = tier1.channels.channel1.type = memory
tier1.channels.channel1.capacity =
tier1.channels.channel1.transactionCapacity = tier1.sinks.sink1.type = hdfs
tier1.sinks.sink1.hdfs.path = /tmp/kafka/%{topic}/%y-%m-%d
tier1.sinks.sink1.hdfs.rollInterval =
tier1.sinks.sink1.hdfs.rollSize =
tier1.sinks.sink1.hdfs.rollCount =
tier1.sinks.sink1.hdfs.fileType = DataStream
tier1.sinks.sink1.channel = channel1

2\

tier1.sources  = source1
tier1.channels = channel1
tier1.sinks = sink1 tier1.sources.source1.type = exec
tier1.sources.source1.command = /usr/bin/vmstat
tier1.sources.source1.channels = channel1 tier1.channels.channel1.type = memory
tier1.channels.channel1.capacity =
tier1.channels.channel1.transactionCapacity = tier1.sinks.sink1.type = org.apache.flume.sink.kafka.KafkaSink
tier1.sinks.sink1.topic = sink1
tier1.sinks.sink1.brokerList = kafka01.example.com:,kafka02.example.com:
tier1.sinks.sink1.channel = channel1
tier1.sinks.sink1.batchSize =

3\

tier1.sources = source1
tier1.channels = channel1
tier1.sinks = sink1tier1.sources.source1.type = exec
tier1.sources.source1.command = /usr/bin/vmstat
tier1.sources.source1.channels = channel1tier1.channels.channel1.type = org.apache.flume.channel.kafka.KafkaChannel
tier1.channels.channel1.capacity =
tier1.channels.channel1.transactionCapacity =
tier1.channels.channel1.brokerList = kafka02.example.com:,kafka03.example.com:
tier1.channels.channel1.topic = channel2
tier1.channels.channel1.zookeeperConnect = zk01.example.com:
tier1.channels.channel1.parseAsFlumeEvent = truetier1.sinks.sink1.type = hdfs
tier1.sinks.sink1.hdfs.path = /tmp/kafka/channel
tier1.sinks.sink1.hdfs.rollInterval =
tier1.sinks.sink1.hdfs.rollSize =
tier1.sinks.sink1.hdfs.rollCount =
tier1.sinks.sink1.hdfs.fileType = DataStream
tier1.sinks.sink1.channel = channel1

总结:

这样配置以后我们可以通过监控,或者消费kafka console打印效果

/bin/kafka-console-consumer.sh –bootstrap-server master:9092 –topic topicTest2 –from-beginning

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,031
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,520
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,368
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,148
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,781
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,859