Flume HA
flume提供fail over和load balance功能
1.添加collector配置(配置两个collector)
# Name the components on this agent
s1.sources = r1
s1.sinks = k1
s1.channels = c1
# Describe/configure the source
s1.sources.r1.type = avro #设置source类型,固定avro
s1.sources.r1.bind = node2 #设置绑定的hostname,agent会上传数据到这个hostname的端口
s1.sources.r1.port = 52020 #设置port
s1.sources.r1.interceptors = avroSerializeInterceptor
s1.sources.r1.interceptors.avroSerializeInterceptor.type = AvroSerializeInterceptor$Builder
#a1.sources.r1.port = 44444
# Describe the sink
s1.sinks.k1.type = org.apache.flume.sink.kafka.KafkaSink
s1.sinks.k1.kafka.topic = tp002
s1.sinks.k1.kafka.bootstrap.servers = 192.168.0.118:9092,192.168.0.118:9093,192.168.0.118:9094
s1.sinks.k1.kafka.flumeBatchSize = 20
s1.sinks.k1.kafka.producer.acks = 1
s1.sinks.k1.kafka.producer.linger.ms = 1
s1.sinks.k1.kafka.producer.compression.type = snappy
# Use a channel which buffers events in memory
s1.channels.c1.type = memory
s1.channels.c1.capacity = 1000
s1.channels.c1.transactionCapacity = 100
# Bind the source and sink to the channel
s1.sources.r1.channels = c1
s1.sinks.k1.channel = c1
2.添加agent配置
# Name the components on this agent
a1.sources = r1
a1.sinks = k1 k2 #设置多个sink
a1.channels = c1
a1.sinkgroups = g1 #设置sinkgroup,为配置load balance或者failover做准备
# Describe/configure the source
a1.sources.r1.channels = c1
a1.sources.r1.type = exec
a1.sources.r1.command = tail -f /tmp/test.log
# Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100
# Describe the sink
a1.sinks.k1.channel = c1
a1.sinks.k1.type = avro
a1.sinks.k1.hostname = node2 #设置要上传数据的hostname和端口,对应collector中的配置
a1.sinks.k1.port = 52020
a1.sinks.k2.channel = c1
a1.sinks.k2.type = avro
a1.sinks.k2.hostname = node2 #同上
a1.sinks.k2.port = 52021
# set sink group
a1.sinkgroups.g1.sinks = k1 k2 #设置group中的sink
# set group
a1.sinkgroups.g1.processor.type = failover #设置sinkgroup处理类型为fail over,取值类型为default,failover,load_balance
a1.sinkgroups.g1.processor.priority.k1 = 1 #设置sink权重
a1.sinkgroups.g1.processor.priority.k2 = 2
a1.sinkgroups.g1.processor.maxpenalty = 10000
Load balance配置

启动collector和agent会有相关日志


Flume HA的更多相关文章
- 海量日志采集Flume(HA)
海量日志采集Flume(HA) 1.介绍: Flume是Cloudera提供的一个高可用的,高可靠的,分布式的海量日志采集.聚合和传输的系统,Flume支持在日志系统中定制各类数据发送方,用于收集数据 ...
- flume的使用
1.flume的安装和配置 1.1 配置java_home,修改/opt/cdh/flume-1.5.0-cdh5.3.6/conf/flume-env.sh文件
- Flume - Kafka日志平台整合
1. Flume介绍 Flume是Cloudera提供的一个高可用的,高可靠的,分布式的海量日志采集.聚合和传输的系统,Flume支持在日志系统中定制各类数据发送方,用于收集数据:同时,Flume提供 ...
- Flafka: Apache Flume Meets Apache Kafka for Event Processing
The new integration between Flume and Kafka offers sub-second-latency event processing without the n ...
- 【翻译】Flume 1.8.0 User Guide(用户指南) Processors
翻译自官网flume1.8用户指南,原文地址:Flume 1.8.0 User Guide 篇幅限制,分为以下5篇: [翻译]Flume 1.8.0 User Guide(用户指南) [翻译]Flum ...
- 【翻译】Flume 1.8.0 User Guide(用户指南) Channel
翻译自官网flume1.8用户指南,原文地址:Flume 1.8.0 User Guide 篇幅限制,分为以下5篇: [翻译]Flume 1.8.0 User Guide(用户指南) [翻译]Flum ...
- 【翻译】Flume 1.8.0 User Guide(用户指南) Sink
翻译自官网flume1.8用户指南,原文地址:Flume 1.8.0 User Guide 篇幅限制,分为以下5篇: [翻译]Flume 1.8.0 User Guide(用户指南) [翻译]Flum ...
- HAProxy + Keepalived + Flume 构建高性能高可用分布式日志系统
一.HAProxy简介 HAProxy提供高可用性.负载均衡以及基于TCP和HTTP应用的代 理,支持虚拟主机,它是免费.快速并且可靠的一种解决方案.HAProxy特别适用于那些负载特大的web站点, ...
- flume学习笔记
#################################################################################################### ...
随机推荐
- JavaScript This 的六道坎
鉴于this风骚的运作方式,对this的理解是永不过时的话题,本文试图通过将其大卸六块来钉住这个磨人的妖精. 首先 this is all about context. this说白了就是找大佬,找拥 ...
- Android图像处理之图形特效处理
一.Android变形矩阵——Matricx: 跟Android图像的色彩处理基本一样,只是将ColorMatrix换成了Matrix,ColorMatrix是4*5的矩阵,Matrix是3*3的.每 ...
- shell中的控制流结构
shell中的控制流结构 1.if...then..else..fi语句 2.case语句 3.for循环 4.until 语句 5.while循环 6.break控制 7.continue 控制 1 ...
- PyPy初体验
PyPy初体验 PyPy安装 1.下载 下载地址:http://pypy.org/download.html(温馨提示:需要梯子) 下载PyPy3.6 64bit Ubuntu版本 解压 下载下来的文 ...
- {"errcode":40029,"errmsg":"invalid code, hints: [ req_id: LEgfftXIRa-BU8_9 ]"}
{"errcode":40029,"errmsg":"invalid code, hints: [ req_id: LEgfftXIRa-BU8_9 ...
- Codeforces 1213E Two Small Strings
cf题面 中文题意 给个n,再给两个长度为2的字符串,要求构造一个长度为\(3n\)的字符串,a.b.c三个字母各n个,且构造出的字符串子串中不能出现给定的两个字符串.如果不存在这样的字符串,就输出N ...
- HDU4587--TWO NODES(无向图割点,暴力出奇迹)这是我见过的时间最长的题。。。
TWO NODES Time Limit: 24000/12000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total ...
- scala实战学习-快速排序
def qSort(a:List[Int]):List[Int]={ if(a.length < 2) a else qSort(a.filter(a.head > _)) ++ a.fi ...
- MYSQL中NULL陷阱
1.NULL值不能做比较,跟任何值比较,NULL值都不会被筛选出来 2.NULL值做数学运算后依旧为NULL,比如 SELECT 5 + NULL 结果为NULL,但是SELECT 5+ '' 结果为 ...
- 分布式-信息方式-ActiveMQ静态网络连接信息回流功能
“丢失”的消息 有这样的场景, broker1和 broker2通过 netwoskconnector连接,一些 consumers连接到 broker1,消费 broker2上的消息.消息先被 br ...