flume

flume组件

匿名 (未验证) 提交于 2019-12-02 23:39:01
Flume组件 1、source interceptor 可形成拦截器链? 模块化开发和可移植性 性能会低一点 ?自定义过ETL拦截器 区分类型拦截器 ? ? 实现interceptor接口 重写四个方法? 创建一个静态内部类 ? ?initialize? ? ?单event intercept ? 多event intercept 使用单event intercept ? close方法? ? 创建一个静态内部类 实现intercept.builder接口 返回一个自定义的拦截器对象 channel selector ? ? replicating? ?event发往全部的channel ? ? multiplexing? 可以选择event发往哪个channel ? 监视器 ?ganglia 监控flume的数据流量 Source 优点 缺点 Taildir Source 断点续传、可同时监控多目录,可自定义监控文件的匹配正则表达式 ? Exec Source 可以实时搜集数据 Flume不运行或者Shell命令出错的情况下,数据将会丢失。 Spooling Directory Source 监控目录 不支持断点续传 kafka source 消费kafuka时使用 ? ? 2、channel ? ? channel 优点 缺点 memary channel

flume文件、目录的采集

匿名 (未验证) 提交于 2019-12-02 23:38:02
spooldir Ŀ¼ exec 文件 目录采集 监视一个目录,只要目录中出现新文件就会采集文件内容 采集完成的文件会被agent自动添加一个后缀 : .COMPLETED #定义三大组件的名称 agent1.sources = source1 agent1.sinks = sink1 agent1.channels = channel1 配置 source 组件 agent1.sources.source1.type = spooldir 定义source的类型 agent1.sources.source1.spoolDir = /home/hadoop/flumelogs/ 监控的目录 agent1.sources.source1.fileHeader = false 配置 sink 组件 agent1.sinks.sink1.type = hdfs sink类型 agent1.sinks.sink1.hdfs.path=hdfs://myha01/flume_log/%y-%m-%d/%H-%M sink上传路径 agent1.sinks.sink1.hdfs.filePrefix = events hdfs文件前缀 agent1.sinks.sink1.hdfs.maxOpenFiles = 5000 agent1.sinks.sink1.hdfs.batchSize=

教你学习大数据入门需要熟练掌握的技术(干货)

匿名 (未验证) 提交于 2019-12-02 23:34:01
附Java/C/C++/机器学习/算法与数据结构/前端/安卓/Python/程序员必读书籍书单大全: 书单导航页(点击 右侧 极客侠栈 即可打开个人博客): 极客侠栈 ① 【Java】学习之路吐血整理技术书从入门到进阶最全50+本(珍藏版) ② 【算法数据结构+acm】从入门到进阶吐血整理书单50+本(珍藏版) ③ 【数据库】从入门到进阶必读18本技术书籍网盘吐血整理网盘(珍藏版) ④ 【Web前端】从HTML到JS到AJAX到HTTP从框架到全栈帮你走更少弯路(珍藏版) ⑤ 【python】书最全已整理好(从入门到进阶)(珍藏版) ⑥ 【机器学习】+python整理技术书(从入门到进阶已经整理好)(珍藏版) ⑦ 【C语言】推荐书籍从入门到进阶带你走上大牛之路(珍藏版) ⑧ 【安卓】入门到进阶推荐书籍整理pdf书单整理(珍藏版) ⑨ 【架构师】之路史诗级必读书单吐血整理四个维度系列80+本书(珍藏版) ⑩ 【C++】吐血整理推荐书单从入门到进阶成神之路100+本(珍藏) 【ios】IOS书单从入门到进阶吐血整理(珍藏版) ------------------------------------------------------------------------------------------------------------------------------------

Flume的load-balance、failover

匿名 (未验证) 提交于 2019-12-02 22:56:40
负载均衡是用于解决一台机器(一个进程)无法解决所有请求而产生的一种算法。Load balancing Sink Processor能够实现load balance功能,如下图Agent1是一个路由节点,负责将Channel暂存的Event均衡到对应的多个Sink组件上,而每个Sink组件分别连接到一个独立的Agent上,示例配置,如下所示: a1.sinkgroups = g1 a1.sinkgroups.g1.sinks = k1 k2 k3 a1.sinkgroups.g1.processor.type = load_balance a1.sinkgroups.g1.processor.backoff = true #如果开启,则将失败的sink放入黑名单 a1.sinkgroups.g1.processor.selector = round_robin # 另外还支持random a1.sinkgroups.g1.processor.selector.maxTimeOut=10000 #在黑名单放置的超时时间,超时结束时,若仍然无法接收,则超时时间呈指数增长 Failover Sink Processor能够实现failover功能,具体流程类似load balance,但是内部处理机制与load balance完全不同。 Failover Sink

How can I force Flume-NG to process the backlog of events after a sink failed?

大憨熊 提交于 2019-12-02 21:12:33
I'm trying to setup Flume-NG to collect various kinds of logs from a bunch of servers (mostly running Tomcat instances and Apache Httpd) and dump them into HDFS on a 5-node Hadoop cluster. The setup looks like this: Each application server tails the relevant logs into a one of the Exec Sources (one for each log type: java, httpd, syslog), which outs them through a FileChannel to an Avro sink. On each server the different sources, channels and sinks are managed by one Agent. Events get picked up by an AvroSource which resides on the Hadoop Cluster (the node that also hosts the SecondaryNameNode

Flume安装和配置(完全分布式)

别来无恙 提交于 2019-12-02 12:08:50
Flume安装和配置 进入路径/usr/local/ cd /usr/local/ 在该路径下解压apache-flume-1.9.0-bin.tar.gz tar -zxvf /root/ apache-flume-1.9.0-bin.tar.gz #tar解压文件,-z调用gzip程序来压缩文件,压缩后的文件名称以.gz结尾,-x解压文件,-v显示详细的tar处理的文件信息,-f要操作的文件名。 mv apache-flume-1.9.0-bin.tar.gz flume #重命名mv 文件名 文件名 将源文件名改为目标文件名 mv 文件名 目录名 将文件移动到目标目录 mv 目录名 目录名 目标目录已存在,将源目录移动到目标目录;目标目录不存在则改名。 配置 三个节点 master slave1 slave2 vi /etc/profile 添加以下内容: wq保存退出,刷新环境变量source /etc/profile source /etc/profile #/etc/profile里面的变量是全局的,对所有用户的shell有效(shell变量是环境变量,是局部的,只对特定的shell有效)。 #source通常用于重新执行刚修改的初始化文件,使之立即生效,而不必注销并重新登录。 #/bin目录存在所有的系统指令(linux默认的自带指令)

Flume HDFS Sink generates lots of tiny files on HDFS

早过忘川 提交于 2019-12-02 07:49:27
I have a toy setup sending log4j messages to hdfs using flume. I'm not able to configure the hdfs sink to avoid many small files. I thought I could configure the hdfs sink to create a new file every-time the file size reaches 10mb, but it is still creating files around 1.5KB. Here is my current flume config: a1.sources=o1 a1.sinks=i1 a1.channels=c1 #source configuration a1.sources.o1.type=avro a1.sources.o1.bind=0.0.0.0 a1.sources.o1.port=41414 #sink config a1.sinks.i1.type=hdfs a1.sinks.i1.hdfs.path=hdfs://localhost:8020/user/myName/flume/events #never roll-based on time a1.sinks.i1.hdfs

Is it possible to write Flume headers to HDFS sink and drop the body?

痞子三分冷 提交于 2019-12-02 00:19:43
The text_with_headers serializer (HDFS sink serializer) allows to save the Flume event headers rather than discarding them. The output format consists of the headers, followed by a space, then the body payload. We would like to drop the body and retain the headers only. For the HBase sink, the "RegexHbaseEventSerializer" allows us to transform the events. But I am unable to find such a provision for the HDFS sink. You can set serializer property to header_and_text , which outputs both the headers and the body. For example: agent.sinks.my-hdfs-sink.type = hdfs agent.sinks.my-hdfs-sink.hdfs

Flume笔记

南楼画角 提交于 2019-12-01 18:57:12
flume自定义拦截器:实现Interceptor接口 flume自定义source:继承AbstractSource flume自定义sink:继承AbstractSink azkaban:任务调度工具。正常使用即可 任务调度,定时执行,任务之间的依赖 sqoop:数据导入导出工具 将关系型数据库当中的数据导入到大数据平台 import 将大数据平台的数据导出到关系型数据库 export 导入mysql数据到hdfs上面去,指定字段之间的分隔符,指定导入的路径 -m 定义多少个mapTask来导入数据 100GB的数据,定义多少个mapTask比较合适 10-30个,大概运行在半个小时以内要结束掉。 增量导入有三个选项 一般都是借助 --where条件来实现,或者使用--query来实现 实际工作当中,每个表一般都维护三个字段,create_time ,update_time ,is_deleted 实际工作当中,基本上都是做假删除 根据update_time可以获取每天的更新的数据或者插入的数据 如果数据发生变化,数仓当中一个人 存在多条数据,怎么办??? 减量的数据怎么办?? 转化成为更新的数据来操作 datax:也是数据导入导出工具 通过Java代码远程执行linux的命令 sshxcute.jar 点击流日志数据分析:主要是分析nginx的日志数据 点击流日志模型:

Flume-ng tail a file

爷,独闯天下 提交于 2019-12-01 14:08:20
I am trying to understand how to tail a file with flume-ng so that I can push the data into HDFS. In the first instance I have setup a simple conf file: tail1.sources = source1 tail1.sinks = sink1 tail1.channels = channel1 tail1.sources.source1.type = exec tail1.sources.source1.command = tail -F /var/log/apache2/access.log tail1.sources.source1.channels = channel1 tail1.sinks.sink1.type = logger tail1.channels.channel1.type = memory tail1.channels.channel1.capacity = 1000 tail1.channels.channel1.transactionCapacity = 100 tail1.sources.source1.channels = channel1 tail1.sinks.sink1.channel =