Flume HDFS 源

Flume HDFS Source

我想使用flume将数据从hdfs目录传输到hdfs中的目录,在这个传输中我想应用处理morphline。

例如:我的来源是

"hdfs://localhost:8020/user/flume/data"

我的水槽是

"hdfs://localhost:8020/user/morphline/"

flume可以吗?

如果是,源的类型是什么 flume?

据我所知,没有读取HDFS数据的来源。主要原因是 Flume 用于移动大量数据,这些数据以某种方式 发送 给代理。如文档中所述:

"A Flume source consumes events delivered to it by an external source like a web server. The external source sends events to Flume in a format that is recognized by the target Flume source. For example, an Avro Flume source can be used to receive Avro events from Avro clients or other Flume agents in the flow that send events from an Avro sink. A similar flow can be defined using a Thrift Flume Source to receive events from a Thrift Sink or a Flume Thrift Rpc Client or Thrift clients written in any language generated from the Flume thrift protocol."

您在 official web page 处拥有所有可用资源。

话虽如此,您将需要一些进程来负责读取输入的 HDFS 文件并将其发送到任何可用的源。可能 ExecSource 适合您的需要,因为您可以指定一个 运行 的命令来生成输入数据。这样的命令可以是 hadoop fs -cat /hdfs/path/to/input/data 或类似的命令。

尽管如此,考虑到您想要进行的处理,我想您需要一个自定义接收器才能实现它。我的意思是,源部分只是用于读取数据并将其以 Flume 事件的形式放入 Flume 通道。然后,一个或多个接收器将通过处理这些事件并生成适当的输出来消耗这些事件。

另一种选择是将 netcat 源连接到同一个接收器,然后 cat 将文件放入其中...