本文尽量翻译官方文档

Apache Flume用于从不同数据源采集、聚合以及移动大量日志数据到一个集中式数据存储中心。它是一个分布式、可靠、高可用的系统。

Apache Flume的用途不仅仅局限于日志数据的采集。由于数据源是可定制的,Flume可以用来传输大量的Event数据,比如:网络流量数据、社交媒体产生的数据、电子邮件等几乎任何可能的数据。

Apache Flume只Apache 基金会的一个顶级项目.

目前有两个版本,分别为versions 0.9.x and 1.x.

本文档适用于1.4.x系列.

新用户和现在的用户推荐使用1.x版本,在最新的架构上能充分利用性能改性提升和配置的灵活性;

系统要求: Java 1.6或更高,推荐1.7,

内存:足够配置的source,sink,channels使用

磁盘空间:足够配置的sink,channels使用

权限,可以被agent读写

数据流模型

Flume Event表示一个数据流单元,它包含一个字节负载和一个可选的字符串属性集合。Flume Agent是一个JVM进程,它有一系列组件,这些组件可以让Event从一个外部源流入下一个目的地(也就是一跳,即hop)。

flume下载安装出现unable to find java executable_数据

(生产者-消费者模型):Flume Source消费外部源(比如Web服务器)传送给它的Event。外部源以一种能够被目标Flume Source识别的数据格式发送Event给Flume。例如,一个Avro(Avro是一个数据序列化的系统,包含RPC功能) Flume Source能够接收Avro客户端发送来的Avro Event[备注:一个Agent情况]或者系统中其他Flume Agent的Avro Sink发来的Avro Event[备注:多个Agent串联的情况下]。同样的道理,可以使用Thrift Source接收来自Thrift Sink或者Flume Thrift RPC客户端或者使用Flume Thrift协议生成的任何语言的客户端的Event,从而实现相似的数据流。

当一个Flume Source接收到一个Event,它就会把它存入一个或多个Channel中。Channel是一个被动的存储器,它会一直存储着Event直到这个Event被一个Flume Sink消费掉。FileChannel就是一个例子–它建立在本地文件系统之上。Flume Sink将Event从Channel中移除,并把它放到外部的存储系统(比如ES,通过Flume Elasticsearch Sink)中或者转发到整个数据流的下一个Flume Agent(也即下一跳)。在同一个Agent中的Source和Sink能够通过Channel存储Event实现异步工作(这句话是agent中sink和source的解耦阐述).

复杂数据流

Flume允许用户创建multi-hop flows(多级跳的数据流),在数据流到达目的地之前event会旅行多个agent .  Flume也允许Fan-in和Fan-out数据流,上下文路由和为失败的跳设置备份路由(故障转移).

备注:(Fan-in)扇入在软件工程中某个模板被上级模块调用的个数,(Fan-out)扇出则表示某个模块调用下级模块的个数。所以这里可以这样理解:扇入[多个数据源或者多个Sink流向一个Agent],扇出[一个数据源流或者一个Sink向多个Agent]。

可靠性

在每个Flume Agent中Event都会先被存储在一个Channel中,然后Event才会被传输到下一个Agent或者最终的存储系统(例如HDFS)。Event只有在下一个Flume Agent的Channel中或者最终的存储系统中存储好才会从当前的Channel中被移除。这就是Flume提供数据流中end to end 的可靠性保证的最基本的单跳消息传递语义;

Flume使用事务的方法保证Event的可靠传递,Flume使用事务的方法保证Event的可靠传递。Source和Sink分别被封装在存储/检索(storage/retrieval)事务中,这些事务由保存event的存储提供或者由Channel提供.这保证了数据流中events集合在点到点的可靠传递,在多级跳数据流的情况下,上一级的Sink和下一级的Source都被包含在事务中,保证数据可靠地从一个Channel到另一个Channel转移.

语句解释:(数据在传输到下个节点时(通常是批量数据),如果接收节点出现异常,比如网络异常,则回滚这一批数据。因此有可能导致数据重发。同个节点内,Source写入数据到Channel,数据在一个批次内的数据出现异常,则不写入到Channel。已接收到的部分数据直接抛弃,靠上一个节点重发数据。)

可恢复性

Event被存储在Channel中,同时Channel管理着传输event事务的失败恢复。Flume支持一个建立在本地文件系统之上的,可持久化的FileChannel。还有一个Memory Channel把Event简单存储在一个内存队列中,它速度更快,但是当一个Flume Agent进程死掉之后,依然存储在Memory Channel中的Event就不能够恢复了。

安装

Flume默认以Java Properties格式的文本文件存储各个配置项,默认路径在/apache-flume-1.6.0-bin/conf中.一个配置文件中可以配置一个或多个Agent。配置文件包含了一个Agent中每一个Source、Sink和Channel的属性。每一个组件(Source,Sink,Channel)都有type,name属性以及跟特性type相关的属性集合。

例如,一个Avro Source需要一个hostname或者是IP地址以及一个端口号去接收数据。一个Memory Channel的最大队列数(“capacity”),一个HDFS Sink需要知道文件系统的URI,创建文件的路径以及文件循环的频率(“hdfs.rollInternal”)等等。一个组件的所有这些属性都需要被设置在这个Flume Agent所以来的配置文件中。

组件串联

Flume Agent需要知道加载什么样的组件,以及如何将这些组件按照循序串起来形成数据流。这就需要列出Agent中每一个Source、Sink和Channel的名字,然后为每一个Source和Sink指定连接的Channel。比如:一个叫dashboard_agent(Agent)中src_log(Source)通过ch_file(Channel)传输Event到sink_es(Sink)中。所以一个典型的配置文件需要包含这些组件。Source和Sink共享Channel。

启动一个agent

Agent通过一个叫做flume-ng的shell脚本启动,flume-ng位于Flume分发包的bin目录下。你需要在命令行指定Agent的名字、配置文件目录以及对应的配置文件:

$ bin/flume-ng agent -n $agent_name -c conf -f conf/flume-conf.properties.template

然后agent就会启动properties文件中配置的source和sinks


简单的示例

这里我们举一个配置文件例子,描述单节点Flume部署。这个配置文件用户生成Event并且把他们顺序地打印到console上。

# example.conf: A single-node Flume configuration

# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1

# Describe/configure the source
a1.sources.r1.type = netcat
a1.sources.r1.bind = localhost
a1.sources.r1.port = 44444

# Describe the sink
a1.sinks.k1.type = logger

# Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100

# Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1



配置文件定了一个名叫a1的Agent,a1有一个监听44444端口的Source,一个把Event暂存到memory(内存)的Channel,一个把Event数据打印到控制台的Sink。这个配置文件命名了各种组件并描述了他们的类型以及配置参数。一个给定的配置文件可以配置多个Agent,当一个给定的Flume进程要被启动时,一个标志会传进去来告诉它到底哪个命名的Agent要被启动。所以我们可以使用如下脚本启动a1:

$ bin/flume-ng agent --conf conf --conf-file example.conf --name a1 -Dflume.root.logger=INFO,console

注:在一个实际的部署中,我们通常会多包含一个配置:--conf=<conf-dir>。<conf-dir>目录包含一个叫做flume-env.sh的shell脚本和一个log4j配置文件。这个例子中我们传入了一个Java选项强制Flume把日志记录在console上,并且不使用定制的环境脚本。


从另一个shell终端,我们可以telnet 44444端口然后发送一个Event:

$ telnet localhost 44444
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
Hello world! <ENTER>
OK

在原来(启动)flume的终端就会以日志的形式打印出:

12/06/19 15:32:19 INFO source.NetcatSource: Source starting
12/06/19 15:32:19 INFO source.NetcatSource: Created serverSocket:sun.nio.ch.ServerSocketChannelImpl[/127.0.0.1:44444]
12/06/19 15:32:34 INFO sink.LoggerSink: Event: { headers:{} body: 48 65 6C 6C 6F 20 77 6F 72 6C 64 21 0D          Hello world!. }



基于Zookeeper的配置

Flume支持通过zookeeper管理Agent配置,但这是一个实验性功能。配置文件需要上传到zookeeper,并存储在节点数据中。比如:

- /flume
 |- /a1 [Agent config file]
 |- /a2 [Agent config file]

 然后通过如下脚本启动Agent:

$ bin/flume-ng agent –conf conf -z zkhost:2181,zkhost1:2181 -p /flume –name a1 -Dflume.root.logger=INFO,console

参数:z表示Zookeeper connection string. Comma separated list of hostname:port


参数:p表示Base Path in Zookeeper to store Agent configurations,默认值为:/flume

安装第三方插件

Flume有一个完整的基于插件的架构。Flume自身提供了很多直接可用的Source、Channel、Sink和Serializer,当然也存在许多第三方实现。

你可以在flume-env.sh中把第三方的jar包添加到FLUME_CLASSPATH变量中来包含定制的组件。但是现在Flume支持一个叫做plugins.d的特殊目录,它会自动把按照一定格式打包起来的Plugin组装起来。这个可以更方便的管理插件打包,以及更简单的调试和跟踪,尤其是jar包依赖冲突。所以我们更推荐使用第二种方式。

plugins.d目录

plugins.d目录位于$FLUME_HOME/plugins.d。在启动时,flume-ng启动脚本查找plugins.d目录下符合以下格式的plugin,然后把他们包含到合适的路径上。

plugin的目录布局

每一个在plugins.d目录的plugin(其实就是子目录)能够包含三个子目录:


lib - the plugin’s jar(s)
    libext - the plugin’s dependency jar(s)
    native - any required native libraries, such as .so files

plugins.d目录下两个plugin的例子:


plugins.d/
plugins.d/custom-source-1/
plugins.d/custom-source-1/lib/my-source.jar
plugins.d/custom-source-1/libext/spring-core-2.5.6.jar
plugins.d/custom-source-2/
plugins.d/custom-source-2/lib/custom.jar
plugins.d/custom-source-2/native/gettext.so



数据采集

Flume有一系列机制来支持从不同数据源采集数据。

RPC

Flume中的一个Avro客户端可以通过Avro RPC机制将一个给定的文件发送给Flume Avro Source:

$ bin/flume-ng avro-client -H localhost -p 41414 -F /usr/logs/log.10

上边的命令会将/usr/logs/log.10的内容发送到监听41414端口的Flume Source上。

执行命令

Flume中有一个exec Source可一个执行一个给定的命令,并且消费的输出。一个输出的一行。例如以’\r’或’\n’或两者结尾的文本。



注:Flume不支持tail作为一个Source。不过你可以封装tail命令到一个exec Source中从而流化文件。

Network streams

Flume支持通过以下机制从常用的日志流中读取数据:

Avro
Thrift
Syslog
Netcat

配置多Agent流

flume下载安装出现unable to find java executable_Source_02

为了使数据可以跨多个Agent和hop,前agent的sink和当前Agent的source需要是Avro类型的,并且Sink指向Source的host(ip)和port。

合并

日志收集中一个常见的场景是大量的日志生产端向少量的和存储系统关联的消费端Agent发送数据。例如,从成百上千个Web服务器收集日志然后发送到十几个写入HDFS集群的Agent。

flume下载安装出现unable to find java executable_Source_03


这可以通过配置多个第一层的带有Avro Sink的Agent,并且所Avro Sink都指向一个单的Agent的Avro Source上。第二层Agent的Source合并接收过来的数据到单独的Channel中,然后由Sink消费并发送到目的地。


拆分流

Flume支持多路输出Event到一个或多个目的地。可以通过定义一个flow multiplexer,用它来复制或选择性路由一个Event到一个或多个Channel中。

flume下载安装出现unable to find java executable_配置文件_04

上边的例子显示了一个叫“foo”的Agent的一个Source扇出数据流到三个不同的Channel中。这个扇出可以是复制或者多路输出.在复制流的情况下,每一个Event被发送到三个Channel中 在多路输出的情况下,一个Event根据它的属性和预定义值的匹配情况被传送到可用Channel一个子集中.比如以下的映射场景可以在配置文件中进行配置:如果一个Event的属性叫做txnType,并且被设置为“customer”,然后它应该被传送到channel1和channel3中, 如果被设置为“vendor”,它应该被传送到channel2中,如果没有到channel2就送到channel3中。

配置

正如前面部分中提到的,Flume agent配置是读取一个具有层次设置的java Properties文件,

定义数据流

要在单个Flume Agent中定义数据流,需要通过Channel将Sources和Sinks连接起来。列出给定Agent的Source和Sink,然后为Source和Sink指定Channel。一个Source可以指定多个Channel,但是一个Sink只能指定一个Channel。格式如下:

# list the sources, sinks and channels for the agent
<Agent>.sources = <Source>
<Agent>.sinks = <Sink>
<Agent>.channels = <Channel1> <Channel2>

# set channel for source
<Agent>.sources.<Source>.channels = <Channel1> <Channel2> ...

# set channel for sink
<Agent>.sinks.<Sink>.channel = <Channel1>



比如:名叫agent_foo的Agent从外部的avro client读取数据,通过memory channel将数据发送到HDFS。配置文件weblog.config可能如下:


# list the sources, sinks and channels for the agent
agent_foo.sources = avro-appserver-src-1
agent_foo.sinks = hdfs-sink-1
agent_foo.channels = mem-channel-1

# set channel for source
agent_foo.sources.avro-appserver-src-1.channels = mem-channel-1

# set channel for sink
agent_foo.sinks.hdfs-sink-1.channel = mem-channel-1



这个配置将会使Event通过名叫mem-channel-1的Channel从avro-AppSrv-source流向hdfs-Cluster1-sink。当Agent以weblog.config作为其配置文件启动时,flume就会实例化这个流。


配置单独的组件

定义数据流之后,你需要为每一个source,sink和channel配置属性,属性位于每个组件类型配置的层次命名空间下:

# properties for sources
<Agent>.sources.<Source>.<someProperty> = <someValue>

# properties for channels
<Agent>.channel.<Channel>.<someProperty> = <someValue>

# properties for sinks
<Agent>.sources.<Sink>.<someProperty> = <someValue>



Flume的每一个组件都需要设置”type”属性,以便Flume判断到底需要那个组件对象。每一个source,sink和chanel都有它自己的属性集合,这些属性都是依据实际情况按需设置的。就像前面的示例中,我们有一个通过名叫mem-channel-1的memory channel从avro-AppSrv-source到hdfs-Cluster1-sink的数据流。下面是一个配置各个组件的示例:

agent_foo.sources = avro-AppSrv-source
agent_foo.sinks = hdfs-Cluster1-sink
agent_foo.channels = mem-channel-1

# set channel for sources, sinks

# properties of avro-AppSrv-source
agent_foo.sources.avro-AppSrv-source.type = avro
agent_foo.sources.avro-AppSrv-source.bind = localhost
agent_foo.sources.avro-AppSrv-source.port = 10000

# properties of mem-channel-1
agent_foo.channels.mem-channel-1.type = memory
agent_foo.channels.mem-channel-1.capacity = 1000
agent_foo.channels.mem-channel-1.transactionCapacity = 100

# properties of hdfs-Cluster1-sink
agent_foo.sinks.hdfs-Cluster1-sink.type = hdfs
agent_foo.sinks.hdfs-Cluster1-sink.hdfs.path = hdfs://namenode/flume/webdata



为Agent添加多个流

单个Flume Agent可以包含多个独立的数据流,你可以在配置中列出多个sources,sinks和channels,这些组件可以相互串联形成数据流:

# list the sources, sinks and channels for the agent
<Agent>.sources = <Source1> <Source2>
<Agent>.sinks = <Sink1> <Sink2>
<Agent>.channels = <Channel1> <Channel2>



然后你可以连接sources和sinks到各自的channel[注:channels for sources,channel for sinks]上,从而形成不同的数据流。比如:你需要在一个Agent中配置两条数据流。一条从外部的avro客户端到外部的HDFS,另一条从tail输出流到avro sink,下面的配置可以实现:

# list the sources, sinks and channels in the agent
agent_foo.sources = avro-AppSrv-source1 exec-tail-source2
agent_foo.sinks = hdfs-Cluster1-sink1 avro-forward-sink2
agent_foo.channels = mem-channel-1 file-channel-2

# flow #1 configuration
agent_foo.sources.avro-AppSrv-source1.channels = mem-channel-1
agent_foo.sinks.hdfs-Cluster1-sink1.channel = mem-channel-1

# flow #2 configuration
agent_foo.sources.exec-tail-source2.channels = file-channel-2
agent_foo.sinks.avro-forward-sink2.channel = file-channel-2

配置多Agent数据流

为设置一个多层的数据流,你需要在第一跳(hop)上使用一个Avro/Thrift Sink指向下一跳的Avro/Thrift Source。这就会使第一个Flume Agent传输Event到下一个Flume Agent。 例如,如果你在使用Avro客户端周期性的发送文件(每个Event包含一个文件)到本地Flume Agent,然后本地Agent又把Event传输到另一个和最终存储系统挂载的Flume Agent上。 请看下面的Weblog Agent配置:

# list sources, sinks and channels in the agent
agent_foo.sources = avro-AppSrv-source
agent_foo.sinks = avro-forward-sink
agent_foo.channels = file-channel

# define the flow
agent_foo.sources.avro-AppSrv-source.channels = file-channel
agent_foo.sinks.avro-forward-sink.channel = file-channel

# avro sink properties
agent_foo.sources.avro-forward-sink.type = avro
agent_foo.sources.avro-forward-sink.hostname = 10.1.1.100
agent_foo.sources.avro-forward-sink.port = 10000

# configure other pieces
#...

HDFS agent config(第二个Agent配置):

# list sources, sinks and channels in the agent
agent_foo.sources = avro-collection-source
agent_foo.sinks = hdfs-sink
agent_foo.channels = mem-channel

# define the flow
agent_foo.sources.avro-collection-source.channels = mem-channel
agent_foo.sinks.hdfs-sink.channel = mem-channel

# avro sink properties
agent_foo.sources.avro-collection-source.type = avro
agent_foo.sources.avro-collection-source.bind = 10.1.1.100
agent_foo.sources.avro-collection-source.port = 10000

# configure other pieces
#...



这里我们连接Weblog Agent的avro-forward-sink到HDFS Agent的avro-collection-source。这就会使来自外部appserver Source的Event最终存储到HDFS中。 注意:Weblog Agent中sink的配置与HDFS Agent source的配置一致


扇出数据流

前面的小节我们提到,Flume支持从一个source扇出数据到多个Channels的数据流。扇出数据流有两种模式:复制和多路。在复制模式中,Event将发送给所有配置的channels,而多路模式,Event将只发送给特定的子集。为扇出数据流,你需要为这个Source指定一个Channel列表以及扇出的策略。这是通过添加一个Channel “selector”(可以是复制或者多路)实现的。这里需要特别指出的是如果使用多路的模式,还需进一步指定选择规则。如果不指定“selector”,默认是复制模式:


# List the sources, sinks and channels for the agent
<Agent>.sources = <Source1>
<Agent>.sinks = <Sink1> <Sink2>
<Agent>.channels = <Channel1> <Channel2>

# set list of channels for source (separated by space)
<Agent>.sources.<Source1>.channels = <Channel1> <Channel2>

# set channel for sinks
<Agent>.sinks.<Sink1>.channel = <Channel1>
<Agent>.sinks.<Sink2>.channel = <Channel2>

<Agent>.sources.<Source1>.selector.type = replicating

多路选择还有一些其他的配置来使数据流分叉。这就需要指定一个Event属性到一个Channel集合的映射。选择器会检查Event Header上配置的每一个属性。如果它匹配了指定的值,那么这个Event就会被发送到跟这个值映射的所有Channel上。如果没有任何匹配,这个Event就会被发送到发送到默认配置的Channel集合上:

# Mapping for multiplexing selector
<Agent>.sources.<Source1>.selector.type = multiplexing
<Agent>.sources.<Source1>.selector.header = <someHeader>
<Agent>.sources.<Source1>.selector.mapping.<Value1> = <Channel1>
<Agent>.sources.<Source1>.selector.mapping.<Value2> = <Channel1> <Channel2>
<Agent>.sources.<Source1>.selector.mapping.<Value3> = <Channel2>
#...

<Agent>.sources.<Source1>.selector.default = <Channel2>

为每个值的映射的Channel集合允许重叠。 下边的例子是一个单一流,它多路输出到两个路径上。名叫agent_foo的Agent有一个单一的Avro Source和两个Channel连接到两个Sink上:

# list the sources, sinks and channels in the agent
agent_foo.sources = avro-AppSrv-source1
agent_foo.sinks = hdfs-Cluster1-sink1 avro-forward-sink2
agent_foo.channels = mem-channel-1 file-channel-2

# set channels for source
agent_foo.sources.avro-AppSrv-source1.channels = mem-channel-1 file-channel-2

# set channel for sinks
agent_foo.sinks.hdfs-Cluster1-sink1.channel = mem-channel-1
agent_foo.sinks.avro-forward-sink2.channel = file-channel-2

# channel selector configuration
agent_foo.sources.avro-AppSrv-source1.selector.type = multiplexing
agent_foo.sources.avro-AppSrv-source1.selector.header = State
agent_foo.sources.avro-AppSrv-source1.selector.mapping.CA = mem-channel-1
agent_foo.sources.avro-AppSrv-source1.selector.mapping.AZ = file-channel-2
agent_foo.sources.avro-AppSrv-source1.selector.mapping.NY = mem-channel-1 file-channel-2
agent_foo.sources.avro-AppSrv-source1.selector.default = mem-channel-1



多路选择器检查Event中一个叫做“State”的Header属性。如果它的值是“CA”,这个Event就会被发送到mem-channel-1,如果它是“AZ”,这个Event就会被发送到file-channel-2,或者如果它是“NY”,那么这个Event就会被发送到这两个Channel上。如果“State” Header属性没有设置或者没有匹配上以上3个的任何一个,这个Event就被发送到mem-channel-1上,它是默认的。

多路选择器也支持可选的Channel。为了为Header指定可选的Channel,“optional”配置参数需要像下边的方式一样使用:

# channel selector configuration
agent_foo.sources.avro-AppSrv-source1.selector.type = multiplexing
agent_foo.sources.avro-AppSrv-source1.selector.header = State
agent_foo.sources.avro-AppSrv-source1.selector.mapping.CA = mem-channel-1
agent_foo.sources.avro-AppSrv-source1.selector.mapping.AZ = file-channel-2
agent_foo.sources.avro-AppSrv-source1.selector.mapping.NY = mem-channel-1 file-channel-2
agent_foo.sources.avro-AppSrv-source1.selector.optional.CA = mem-channel-1 file-channel-2
agent_foo.sources.avro-AppSrv-source1.selector.mapping.AZ = file-channel-2
agent_foo.sources.avro-AppSrv-source1.selector.default = mem-channel-1

多路选择器将会首先尝试向必需的Channel上写入,如果这些必需的Channel中有任何一个没有成功消费Event,整个事务将会失败,接着事务将会在所有的必需的Channel上重试,当所有必需的Channel都成功的消费了Event,多路选择器才会尝试向可选的Channel上写入。并且可选的Channel中有任何消费Event失败,Flume也会简单忽略它而不会重试。


如果一个特殊Header的可选Channel集合和必选Channel集合有重叠,那么这些Channel就被认为是必选的,那自然在这些Channel的失败会导致所有Channel的重试。例如,上边的例子中,“CA” Header对应的mem-channel-1就被认为是必选的Channel,尽管它同时被标记为必选和可选的,对这个Channel的写入失败将会导致跟这个选择器关联的所有Channel上重试。

如果一个Header并没有配置任何必选的Channel,那么这个Event将会被写入默认的Channel上,并且将会尝试写入到跟这个Header关联的可选Channel上。如果指定了可选的Channel,而没有指定必选的Channel,依然会导致Event被发送到默认的Channel上。如果没有Channel被指定为默认的并且也没有必选的,选择器会尝试将Event写入到可选的Channel中。这种情况下,任何的失败都会被简单忽略并且不在重试

Flume Sources
Avro Source

侦听的Avro端口和接收来自外部的Avro客户端数据流的event。当使用内置的Avro水槽和另一个(前一跳)Flume agent配对时,它可以创建分层集合拓扑。所需的属性是粗写的。



属性	默认	描述
channels	–	 
type	–	组件类型 必须为 avro
bind	–	监听的ip地址或hostname
port		–	绑定的端口


 threads	–	工作最大线程数
selector.type	 	 
selector.*	 	 
interceptors	–	空格分割的拦截器列表
interceptors.*	 	 
compression-type	none	可以是 “none” 或者 “deflate”.压缩类型必须与AvroSource的亚索类型匹配
ssl	false	如果设置为ture,表示启用SSL加密. 你还必须指定一个 “keystore” 和 “keystore-password”.
keystore	–	java密钥存储文件路径. 需要SSL.
keystore-password	–	密码为java密钥. 需要SSL.
keystore-type	JKS	java密钥库的类型. 可以是“JKS” or “PKCS12”.
exclude-protocols	SSLv3	用空格分割列表,排除的SSL/TLS 协议. 除了指定协议外SSLv3 将一直被排除
ipFilter	false	设置为true 为netty激活 ipFiltering
ipFilterRules	–	Define N netty ipFilter pattern rules with this config.

例如,对于代理命名为a1:

a1.sources = r1
a1.channels = c1
a1.sources.r1.type = avro
a1.sources.r1.channels = c1
a1.sources.r1.bind = 0.0.0.0
a1.sources.r1.port = 4141