processor示例
来源:互联网 发布:快递软件系统软件 编辑:程序博客网 时间:2024/06/03 14:56
sink group允许组织多个sink到一个实体上,sink processors能够提供在组内所有sink之间实现负载均衡的能力,而且在失败的情况下能够进行故障转移从一个sink到另外一个sink
1、default sink processor
接收单一的sink,不强制用户为sink创建processor
2、failover sink processor
其维护了一个优先级列表,保证没一个有效的事件都会被处理。
故障转移的工作原理是将连续失败的sink分配到一个池中,在那里被分配一个冷冻期。一旦sink成功发送一个event,sink将会被还原到live池中。
在这配置中,要设置sink group processor为failover,需要为所有的sink分配优先级,所有的优先级数字必须是唯一的。此外failover time的上限可以通过maxpenalty属性进行设置
3、load balancing sink processor
负载均衡片处理器提供在多个sink之间负载均衡流量的能力。实现支持通过round_robin或者random参数来实现负载分发,默认情况下使用round_robin,但可以通过设置覆盖这个默认值。还可以通过集成AbstractSinkProcessor类来实现用户自己的选择机制。
当被调用的时候,这个选择器通过配置的选择规则选择下一个sink来调用。
13、case14_failover_sink.conf
#配置内容
#name the component on this agent
a1.sources = r1
a1.channels= c1 c2
a1.sinks = k1 k2
a1.sinkgroups = g1
a1.sinkgroups.g1.sinks = k1 k2
a1.sinkgroups.g1.processor.type = failover
a1.sinkgroups.g1.processor.priority.k1 = 5
a1.sinkgroups.g1.processor.priority.k2 = 10
a1.sinkgroups.g1.processor.maxpenalty = 10000
#describe/configure the source
a1.sources.r1.type = syslogtcp
a1.sources.r1.host= localhost
a1.sources.r1.port = 5140
a1.sources.r1.selector.type = replicating
a1.sources.r1.channels = c1 c2
#decribe the sink
a1.sinks.k1.type = avro
a1.sinks.k1.hostname= 192.168.0.106
a1.sinks.k1.port = 4443
a1.sinks.k1.channel = c1
a1.sinks.k2.type = avro
a1.sinks.k2.hostname= 192.168.0.107
a1.sinks.k2.port = 4443
a1.sinks.k2.channel = c1
#use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100
a1.channels.c2.type = memory
a1.channels.c2.capacity = 1000
a1.channels.c2.transactionCapacity = 100
case14_failover_s1.conf
#配置内容
#name the component on this agent
a1.sources = r1
a1.channels= c1
a1.sinks = k1
#describe/configure the source
a1.sources.r1.type = avro
a1.sources.r1.bind = 192.168.0.105
a1.sources.r1.port = 4443
a1.sources.r1.channels = c1
#decribe the sink
a1.sinks.k1.type = logger
a1.sinks.k1.channel = c1
#use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100
case14_failover_s2.conf
#配置内容
#name the component on this agent
a1.sources = r1
a1.channels= c1
a1.sinks = k1
#describe/configure the source
a1.sources.r1.type = avro
a1.sources.r1.bind = 192.168.0.105
a1.sources.r1.port = 4443
a1.sources.r1.channels = c1
#decribe the sink
a1.sinks.k1.type = logger
a1.sinks.k1.channel = c1
#use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100
14、case15_load_sink.conf
#配置内容
#name the component on this agent
a1.sources = r1
a1.channels= c1
a1.sinks = k1 k2
a1.sinkgroups = g1
a1.sinkgroups.g1.sinks = k1 k2
a1.sinkgroups.g1.processor.type = load_balance
a1.sinkgroups.g1.processor.backoff = true
a1.sinkgroups.g1.processor.selector= round_robin
#describe/configure the source
a1.sources.r1.type = syslogtcp
a1.sources.r1.host= localhost
a1.sources.r1.port = 5140
a1.sources.r1.channels = c1
#decribe the sink
a1.sinks.k1.type = avro
a1.sinks.k1.hostname= 192.168.0.106
a1.sinks.k1.port = 4443
a1.sinks.k1.channel = c1
a1.sinks.k2.type = avro
a1.sinks.k2.hostname= 192.168.0.107
a1.sinks.k2.port = 4443
a1.sinks.k2.channel = c1
#use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100
case15_load_s1.conf
#配置内容
#name the component on this agent
a1.sources = r1
a1.channels= c1
a1.sinks = k1
#describe/configure the source
a1.sources.r1.type = avro
a1.sources.r1.bind = 192.168.0.105
a1.sources.r1.port = 4443
a1.sources.r1.channels = c1
#decribe the sink
a1.sinks.k1.type = logger
a1.sinks.k1.channel = c1
#use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100
case14_load_s2.conf
#配置内容
#name the component on this agent
a1.sources = r1
a1.channels= c1
a1.sinks = k1
#describe/configure the source
a1.sources.r1.type = avro
a1.sources.r1.bind = 192.168.0.105
a1.sources.r1.port = 4443
a1.sources.r1.channels = c1
#decribe the sink
a1.sinks.k1.type = logger
a1.sinks.k1.channel = c1
#use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100
0 0
- processor示例
- Java processor
- UVA1422 - Processor
- processor register
- thread processor
- 【转载】Gallery of Processor Cache Effects —— 7个简单至极的代码示例,覆盖了Cache Line、Cache Size、False Sharing等重要知识点
- Xilinx Processor IP Library
- Portability-Processor Endianism
- Linux "processor affinity" explained
- Animated Model Processor
- ARM Linux Processor Information
- ARM Processor & Keil 8051
- Address Disposition for Processor
- 什么是Processor affinity
- QUALCOMM_ATCoP(AT Command Processor)
- timing speculation processor
- DSP(Digital signal processor)
- Processor Seoul 2008
- struts2 跳转类型 result type=chain、dispatcher、redirect(redirect-action)_forever
- HDU 1712 ACboy needs your help(简单01背包)
- selector示例
- 测试DML语言
- The 16th Zhejiang University Programming Contest-
- processor示例
- eclipse配置jdk源码
- Mysql海量数据--导入导出、备份恢复方法
- elasticsearch的路由选择
- ArcGIS Runtime SDK for iOS(一) – 实现地图的不同点的callout展示
- nyoj1239(最小生成树)
- 测试preparedStatement语句
- 一个人的旅行
- 元素出栈、入栈顺序的合法性