Apache Flume is a distributed, reliable, and high-availability (HA) system that effectively collects, aggregates, and moves large amounts of log data from various data sources to a central data store.
Scenarios
Flume is most commonly used for log collection. It can also transfer other types of data through a custom Source.
Flume sends data to real-time computing platforms, such as Flink, Spark Streaming, and Storm, and to offline computing platforms, such as MapReduce (MR), Hive, and Presto. Flume can also send data directly to storage systems, such as Hadoop Distributed File System (HDFS), OSS, Kafka, and Elasticsearch. This prepares the data for subsequent analysis and traffic scrubbing.
Architecture
A Flume Agent is an instance of Flume. It is a Java Virtual Machine (JVM) process that controls the data stream of Events from producers to consumers. A Flume Agent consists of a Source, a Channel, and a Sink. A Source can write to multiple Channels, and multiple Sinks can read from a single Channel.
Terms
|
Name |
Description |
|
Event |
An Event is the basic unit of data that flows through a Flume Agent. An Event consists of an optional Header map and a byte array that contains the data. An example follows.
|
|
Source |
A Source is a data collector. It collects data from an external data source and sends it in batches to one or more Channels. Common Sources include the following:
|
|
Channel |
It serves as a buffer queue between the Source and the Sink. Common Channels include the following:
|
|
Sink |
A Sink gets an Event from a Channel and commits it to external storage in a transaction. After the transaction is successfully committed, the Event is removed from the Channel. Common Sinks include the following:
|