Apache Flume
Flume is a distributed(分布式), reliable(高可靠的), and available(高可用的) service for efficiently collecting(收集), ,aggregating(聚合,存在哪里?磁盘/内存?), and moving(移动) large amounts of log data.
It has a simple and flexible(简单灵活) architecture based on streaming data flows(流数据). It is robust and fault tolerant(健壮,容错) with tunable reliability mechanisms and many failover and recovery mechanisms. It uses a simple extensible data model that allows for online(在线) analytic application.
可靠性:当节点出现故障时,日志能够被传送到其他节点上而不会丢失。Flume提供了三种级别的可靠性保障,从强到弱依次为:end-to-end(收集到数据agent首先将event写到磁盘上,当数据传送成功后,再删除,如果发送失败,可以重新发送。);Store on failure(这也是scribe采用的策略,当数据接收方crash时,将数据写到本地,待恢复后,继续发送);Best effort(数据发送到接收方后,不会进行确认)。
Flume发展史
- Cloudera 0.9.2 Flume-OG(0.94.0版本,日志传输不稳定的现象尤为严重,这点可以在BigInsights产品文档的troubleshooting板块发现)
- 2011.10.22 flume-728 Flume-NG ==> Apache
- 2012.7 1.0
- 2015.5 1.6
- ~ 1.8
Flume核心组件
- Source: 数据收集
- Channel: 数据聚集,数据管道。Memory Channel/Kafka Channel/File Channel
- Sink: 数据输出, HDFS Sink/Hive Sink/Kafka Sink...
Flume安装
- Java Runtime Environment - Java 1.7 or later
- Memory - Sufficient memory(足够内存) for configurations used by sources, channels or sinks
- Disk Space - Sufficient disk space(足够磁盘空间) for configurations used by channels or sinks
- Directory Permissions - Read/Write permissions(目录权限) for directories used by agent
1. JDK安装
- 下载jdk1.8.0_144,解压到/opt/.
- 将java配置系统环境变量中: /etc/profile export JAVA_H