FLume监控文件夹,将数据发送给Kafka以及HDFS的配置文件详解
详细配置文件flume-conf.properties如下:
############################################
# producer config
########################################### #agent section
producer.sources = s
producer.channels = c c1
producer.sinks = r r1 #source section
#producer.sources.s.type = exec
#producer.sources.s.command = tail -f -n+1 /usr/local/test.log producer.sources.s.type = spooldir
producer.sources.s.spoolDir = /usr/local/testlog
producer.sources.s.fileHeader = true
producer.sources.s.batchSize = 100 producer.sources.s.channels = c c1 # Each sink's type must be defined
producer.sinks.r.type = org.apache.flume.plugins.KafkaSink
producer.sinks.r.metadata.broker.list=127.0.0.1:9092
producer.sinks.r.partition.key=0
producer.sinks.r.partitioner.class=org.apache.flume.plugins.SinglePartition
producer.sinks.r.serializer.class=kafka.serializer.StringEncoder
producer.sinks.r.request.required.acks=0
producer.sinks.r.max.message.size=1000000
producer.sinks.r.producer.type=sync
producer.sinks.r.custom.encoding=UTF-8
producer.sinks.r.custom.topic.name=topcar #store in HDFS
producer.sinks.r1.type = hdfs
producer.sinks.r1.channel = c1
producer.sinks.r1.hdfs.path=hdfs://node2:9000/user/flume/events/%Y-%m-%d-%H
producer.sinks.r1.hdfs.filePrefix=events-
#producer.sinks.r1.hdfs.fileSuffix = .log #设定后缀
producer.sinks.r1.hdfs.round = true
producer.sinks.r1.hdfs.roundValue = 10
producer.sinks.r1.hdfs.roundUnit = minute
#--文件格式:默认SequenceFile,可选 DataStream \ CompressedStream
producer.sinks.r1.hdfs.fileType=DataStream
#--Format for sequence file records. “Text” or “Writable”
producer.sinks.r1.hdfs.writeFormat=Text
producer.sinks.r1.hdfs.rollInterval=0
#--触发roll操作的文件大小in bytes (0: never roll based on file size)
producer.sinks.r1.hdfs.rollSize=128000000
#--在roll操作之前写入文件的事件数量(0 = never roll based on number of events)
producer.sinks.r1.hdfs.rollCount=0
producer.sinks.r1.hdfs.idleTimeout=60
#--使用local time来替换转移字符 (而不是使用event header的timestamp)
producer.sinks.r1.hdfs.useLocalTimeStamp = true producer.channels.c1.type = memory
producer.channels.c1.capacity = 1000
producer.channels.c1.transactionCapacity=1000
producer.channels.c1.keep-alive=30 #Specify the channel the sink should use
producer.sinks.r.channel = c # Each channel's type is defined.
producer.channels.c.type = memory
producer.channels.c.capacity = 1000 ############################################
# consumer config
########################################### consumer.sources = s
consumer.channels = c
consumer.sinks = r consumer.sources.s.type = seq
consumer.sources.s.channels = c
consumer.sinks.r.type = logger consumer.sinks.r.channel = c
consumer.channels.c.type = memory
consumer.channels.c.capacity = 100 consumer.sources.s.type = org.apache.flume.plugins.KafkaSource
consumer.sources.s.zookeeper.connect=127.0.0.1:2181
consumer.sources.s.group.id=testGroup
consumer.sources.s.zookeeper.session.timeout.ms=400
consumer.sources.s.zookeeper.sync.time.ms=200
consumer.sources.s.auto.commit.interval.ms=1000
consumer.sources.s.custom.topic.name=topcar
consumer.sources.s.custom.thread.per.consumer=4
Flume启动命令如下:
bin/flume-ng agent --conf conf --conf-file conf/flume-conf.properties --name producer -Dflume.root.logger=INFO,console
FLume监控文件夹,将数据发送给Kafka以及HDFS的配置文件详解的更多相关文章
- Python 的 pyinotify 模块 监控文件夹和文件的变动
官方参考: https://github.com/seb-m/pyinotify/wiki/Events-types https://github.com/seb-m/pyinotify/wiki/I ...
- Storm监控文件夹变化 统计文件单词数量
监控指定文件夹,读取文件(新文件动态读取)里的内容,统计单词的数量. FileSpout.java,监控文件夹,读取新文件内容 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...
- 【.Net 学习系列】-- FileSystemWatcher 监控文件夹新生成文件,并在确认文件没有被其他程序占用后将其移动到指定文件夹
监控文件夹测试程序: using System; using System.Collections.Generic; using System.IO; using System.Linq; using ...
- [转帖]Linux下inotify监控文件夹状态,发生变化后触发rsync同步
Linux下inotify监控文件夹状态,发生变化后触发rsync同步 https://www.cnblogs.com/fjping0606/p/6114123.html 1.安装工具--inotif ...
- 1.8-1.10 大数据仓库的数据收集架构及监控日志目录日志数据,实时抽取之hdfs系统上
一.数据仓库架构 二.flume收集数据存储到hdfs 文档:http://flume.apache.org/releases/content/1.9.0/FlumeUserGuide.html#hd ...
- 网卡配置文件详解 用户管理与文件权限篇 文件与目录权限 软连接 tar解压命令 killall命令 linux防火墙 dns解析设置 计划任务crond服务 软件包安装 阿里云 yum源 安装
Linux系统基础优化及常用命令 Linux基础系统优化 引言没有,只有一张图. Linux的网络功能相当强悍,一时之间我们无法了解所有的网络命令,在配置服务器基础环境时,先了解下网络参数设定命令. ...
- Nagios监控平台搭建及配置文件详解
Nagios是一款开源的免费网络监视工具,能有效监控Windows.Linux和Unix的主机状态,交换机路由器等网络设置,打印机等.在系统或服务状态异常时发出邮件或短信报警第一时间通知网站运维人员, ...
- Spring配置文件详解 – applicationContext.xml文件路径
Spring配置文件详解 – applicationContext.xml文件路径 Java编程 spring的配置文件applicationContext.xml的默 ...
- 如何用R来处理数据表的长宽转换(图文详解)
不多说,直接上干货! 很多地方都需用到这个知识点,比如Tableau里. 通常可以采取如python 和 r来作为数据处理的前期. Tableau学习系列之Tableau如何通过数据透视表方式读取 ...
随机推荐
- Session机制一(基础知识点)
一: 1.介绍 对于会话与状态管理,有两种方式,cookie与session. 其中,cookie机制采用客户端保持cookie的方案. 而,session机制采用的是服务器保持Http状态信息的方案 ...
- Rob Pike:我得到的最佳编程建议
Rob Pike:我得到的最佳编程建议 Rob Pike,目前谷歌公司最著名的软件工程师之一,曾是贝尔实验室Unix开发团队成员,Plan9操作系统开发的主要领导人,Inferno操作系统开发的主要领 ...
- win32创建窗口函数(windows程序内部运行机制)
利用win32创建窗口函数,主要操作步骤为: 1.设计一个窗口类 2.注册窗口类 3.创建窗口 4.显示及窗口更新 5.消息循环 6.窗口过程函数 (1)设计一个窗口类 设计窗口类,这样的类型已经 ...
- 转 TCP/IP的三次握手与四次挥手详解
TCP((Transmission Control Protocol)传输控制协议,是一个面向连接的协议.在运用此协议进行数据传输前都会进行连接的建立工作(三次握手):当数据传输完毕,连接的双方都会通 ...
- IE7 css兼容问题
1,float:right; 在IE错位问题 : 使用position:absolute:right:0px; 2,汉字在float状态下 折行 ,可能是因为父级宽度不够, 改用 display:in ...
- ROWID面试题-删除表中重复数据(重复数据保留一个)
/* ROWID是行ID,通过它一定可以定位到r任意一行的数据记录 ROWID DNAME DEPTNO LOC ------------------ ------------------------ ...
- webpack4 + vue + vue-router + vuex
ps: 所有案例使用的 node 及 npm 版本如下 node版本: v8.4.0 npm: 5.3.0 下一个案例默认是接着上一个继续写的 建议先熟悉以下文档 vue vue-router vue ...
- maven中跳过单元测试(转)
你可能想要配置 Maven 使其完全跳过单元测试. 可能你有一个很大的系统,单元测试需要花好多分钟来完成,而你不想在生成最终输出前等单元测试完成. 你可能正工作在一个遗留系统上面,这个系统有一系列的失 ...
- linux系统时间同步,硬件时钟和系统时间同步,时区的设置
1.时间同步(手动): date -s "2015-07-15 22:13:30" hwclock --systohc (表示系统时间同步到硬件时钟) hwclo ...
- 全栈project师体能备战--知识面(1--10)
javascript 单例设计模式: 单例模式确保某个类仅仅有一个势力,并且自行实例化并向整个系统提供这个实例.如:cocos2dx中的导演类.[样例]我有6哥美丽的老婆,他们的老公都 ...