flume kafka 配置指南

摘要:
1、官方网站也有配置:https://flume.apache.org/FlumeUserGuide.html#kafka-source2、clodera官方配置https://www.cloudera.com/documentation/kafka/2-0-x/topics/kafka_flume.html1tier1.sources=source1tier1.channels=channel1

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:2181tier1.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 = 100
 tier1.channels.channel1.type =memory
 tier1.channels.channel1.capacity = 10000tier1.channels.channel1.transactionCapacity = 1000
 tier1.sinks.sink1.type =hdfs
 tier1.sinks.sink1.hdfs.path = /tmp/kafka/%{topic}/%y-%m-%d
 tier1.sinks.sink1.hdfs.rollInterval = 5tier1.sinks.sink1.hdfs.rollSize = 0tier1.sinks.sink1.hdfs.rollCount = 0tier1.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 1tier1.sources.source1.channels =channel1
 
 tier1.channels.channel1.type =memory
 tier1.channels.channel1.capacity = 10000tier1.channels.channel1.transactionCapacity = 1000
 tier1.sinks.sink1.type =org.apache.flume.sink.kafka.KafkaSink
 tier1.sinks.sink1.topic =sink1
 tier1.sinks.sink1.brokerList = kafka01.example.com:9092,kafka02.example.com:9092tier1.sinks.sink1.channel =channel1
 tier1.sinks.sink1.batchSize = 20

3

tier1.sources =source1
tier1.channels =channel1
tier1.sinks =sink1

tier1.sources.source1.type =exec
tier1.sources.source1.command = /usr/bin/vmstat 1tier1.sources.source1.channels =channel1

tier1.channels.channel1.type =org.apache.flume.channel.kafka.KafkaChannel
tier1.channels.channel1.capacity = 10000tier1.channels.channel1.transactionCapacity = 1000tier1.channels.channel1.brokerList = kafka02.example.com:9092,kafka03.example.com:9092tier1.channels.channel1.topic =channel2
tier1.channels.channel1.zookeeperConnect = zk01.example.com:2181tier1.channels.channel1.parseAsFlumeEvent = true
tier1.sinks.sink1.type =hdfs
tier1.sinks.sink1.hdfs.path = /tmp/kafka/channel
tier1.sinks.sink1.hdfs.rollInterval = 5tier1.sinks.sink1.hdfs.rollSize = 0tier1.sinks.sink1.hdfs.rollCount = 0tier1.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

免责声明:文章转载自《flume kafka 配置指南》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇CEF拦截js层alert弹窗 OnJSDialog 《转》mysql max_allowed_packet过小导致的prepare失败下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

Hadoop学习笔记—19.Flume框架学习

Hadoop学习笔记—19.Flume框架学习 START:Flume是Cloudera提供的一个高可用的、高可靠的开源分布式海量日志收集系统,日志数据可以经过Flume流向需要存储终端目的地。这里的日志是一个统称,泛指文件、操作记录等许多数据。 一、Flume基础理论 1.1 常见的分布式日志收集系统 Scribe是facebook开源的日志收集系统,...

hadoop2升级的那点事情(详解)

前言 前阵子,公司的hadoop从hadoop1.02升级到hadoop2.4.1,记录下升级的步骤和遇到的问题,和大家分享,希望别人可以少走一些弯路 技术选型 当前使用版本:apache hadoop 1.0.2hive 0.10升级目标版本Apache hadoop 2.4.1Hive 0.13 升级风险点 Hdfs的升级Hadoop升级最主要是hdf...

Flink写入kafka时,只写入kafka的部分Partitioner,无法写所有的Partitioner问题

1. 写在前面 在利用flink实时计算的时候,往往会从kafka读取数据写入数据到kafka,但会发现当kafka多个Partitioner时,特别在P量级数据为了kafka的性能kafka的节点有十几个时,一个topic的Partitioner可能有几十个甚至更多,发现flink写入kafka的时候没有全部写Partitioner,而是写了部分的Par...

flume 1.7在windows下的安装部署与测试运行

一、安装 安装java,配置环境变量。 安装flume,下载地址,下载后直接解压即可。 二、运行 创建配置文件:在解压后的文件 apache-flume-1.7.0-binconf下创建一个example.conf,内容如下 1 # example.conf: A single-node Flume configuration 2 3 # Nam...

【流数据处理】MySql/PG/Oracle+Kafka+Flink(CDC捕获) 部署及实时计算

主要介绍实时数仓得部署、计算 文章主要分3部分 数据采集 $color{red}{[E]}$ 关系型数据库MySql/PG/Oracle+Debezium+Kafka Connector 数据计算 $color{red}{[T]}$ Flink 数据存储 $color{red}{[L]}$ 传输,关系型数据库/列式数据库 clickhouse/hbase...

Ubuntu 安装 Hadoop(伪分布模式)

在Ubuntu14.04下安装Hadoop2.4.0 (单机模式)基础上配置一、配置core-site.xml /usr/local/hadoop/etc/hadoop/core-site.xml 包含了hadoop启动时的配置信息。 编辑器中打开此文件 sudo gedit /usr/local/hadoop/etc/hadoop/core-site....