本文根据flume官网提供的Flume 1.8.0 User Guide整理得出的,主要包括flume1.8.0支持的各类source(以下表)及其说明。html
码一个网址:http://blog.csdn.net/accountwcx/article/details/49121663java
source类别 | type | 数据来源 | 可靠性 | 说明 |
Avro Source | avro | external Avro client streams | ||
Thrift Source | thrift | external Thrift client streams | ||
Exec Source | exec | Unix command | 不可靠apache |
该命令必须可以连续地在标准输出(控制台)产生数据,如cat、tail -f等。反例:date异步 注意:对于Exec Source或者其余异步source,当flume接收数据失败时没法告知写入方接收数据失败。tcp (举例:当Exec Source执行的命令是tail -f log.txt时,其中log.txt是某个应用的日志文件,该应用会持续不断地写入日志文件。假设flume agent中的channel已经被写满,此时再有数据产生,flume已经没法处理,但flume没法告知该应用数据接收失败。所以,这部分数据就没法经过flume管道继续向下传输,即产生了数据丢失。)ide |
JMS Source | jms | JMS destination测试 such as a queue or topic ui |
能够使用任何JMS提供方,但只能使用ActiveMQ测试spa |
|
Spooling Directory Source | spooldir | 磁盘上的某一具体目录 | 可靠.net |
监测该目录中的文件变化并读取变更内容。 亮点:Spooling Directory Source是可靠的,即便flume进程被重启或者中止也不会丢失数据。 为了保证Spooling Directory Source的可靠性,其监测的目录必须遵循如下两条原则: 1.将某个文件移动到该目录后,不能再被写入内容; 2.该目录下每一个文件的名称必须是惟一的,包括已经被flume处理的文件。 当该目录下某个文件被写入内容或者发生文件名冲突时,flume会输出错误信息并中止flume进程。 |
Talidir Source | TAILDIR | 文件组合(多个文件) | 可靠 |
工做方式:近实时地监测各个文件,当某个文件有新行写入时,待文件写入完成,flume会读取新写入的行。 |
Twitter 1% firehose Source(实验性) | org.apache.flume.source.twitter.TwitterSource |
Experimental source that connects via Streaming API to the 1% sample twitter firehose,continously downloads tweets, converts them to Avro format and sends Avro events to a downstream Flume sink. 注意:这个source是实验性提供,在flume的每一个小版本中均可能变更,在应用时请留意版本并考察其稳定性。 |
||
Kafka Source | org.apache.flume.source.kafka.KafkaSource |
Kafka topics | ||
NetCat TCP Source | netcat | 某个TCP端口接收到的数据 | 工做方式:监听某个TCP端口,将每行数据都转换成一个event并进行传输。 | |
NetCat UDP Source | netcatudp | 某个UDP端口接收到的数据 | 工做方式:监听某个UDP端口,将每行数据都转换成一个event并进行传输。 | |
Sequence Generator Source | seq | 本身生成 | 工做方式:一个简单的序列生成器(由0到totalEvents,步进值为1,默认的totalEvents是java Long型数据的最大值)。主要用于测试。 注意:当没法向channel发送event时,本source会从新尝试发送。 |
|
Syslog TCP Source | syslogtcp | 单个TCP端口产生的系统日志 | 这三个source同属于Syslog Sources,工做方式都相似: 工做方式:Reads syslog data and generate Flume events.The UDP source treats an entire message as a single event. The TCP sources create a new event for each string of characters separated by a newline (‘n’). |
|
Multiport Syslog TCP Source | multiport_syslogtcp | 多个TCP端口产生的系统日志 | ||
Syslog UDP Source | syslogudp | 单个UDP端口产生的系统日志 | ||
HTTP Source | http | 经过HTTP POST/GET 发送的event数据 |
注意:1.GET方式是实验性的 2.HTTP requests are converted into flume events by a pluggable “handler” which must implement the HTTPSourceHandler interface. |
|
Stress Source | org.apache.flume.source.StressSource |
本身生成 | 内部负载生成source,主要用于压力测试,能够配置event的负载大小。 |
|
Avro Legacy Source | org.apache.flume.source.avroLegacy.AvroLegacySource |
Flume 0.9.4 agents | 这两个source同属于一个大类:Legacy Sources,负责接收Flume 0.9.4 agents发送的events并转换成Flume 1.0 format,而后存储在指定的channel中。 |
|
Thirft Legacy Source | org.apache.flume.source.thriftLegacy.ThriftLegacySource |
|||
Custom Source | 自定义的FQCN | 自定义 | A custom source is your own implementation of the Source interface. A custom source’s class and its dependencies must be included in the agent’s classpath when starting the Flume agent. The type of the custom source is its FQCN. |
|
Scribe Source | org.apache.flume.source.scribe.ScribeSource |
外部的scribe客户端 | Scribe is another type of ingest system. To adopt existing Scribe ingest system, Flume should use ScribeSource based on Thrift with compatible transfering protocol. For deployment of Scribe please follow the guide from Facebook.(scribe是Facebook公司开发的,因此须要结合Facebook提供的文档进行开发) |