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的更多相关文章

  1. 海量日志采集Flume(HA)

    海量日志采集Flume(HA) 1.介绍: Flume是Cloudera提供的一个高可用的,高可靠的,分布式的海量日志采集.聚合和传输的系统,Flume支持在日志系统中定制各类数据发送方,用于收集数据 ...

  2. flume的使用

    1.flume的安装和配置 1.1 配置java_home,修改/opt/cdh/flume-1.5.0-cdh5.3.6/conf/flume-env.sh文件

  3. Flume - Kafka日志平台整合

    1. Flume介绍 Flume是Cloudera提供的一个高可用的,高可靠的,分布式的海量日志采集.聚合和传输的系统,Flume支持在日志系统中定制各类数据发送方,用于收集数据:同时,Flume提供 ...

  4. 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 ...

  5. 【翻译】Flume 1.8.0 User Guide(用户指南) Processors

    翻译自官网flume1.8用户指南,原文地址:Flume 1.8.0 User Guide 篇幅限制,分为以下5篇: [翻译]Flume 1.8.0 User Guide(用户指南) [翻译]Flum ...

  6. 【翻译】Flume 1.8.0 User Guide(用户指南) Channel

    翻译自官网flume1.8用户指南,原文地址:Flume 1.8.0 User Guide 篇幅限制,分为以下5篇: [翻译]Flume 1.8.0 User Guide(用户指南) [翻译]Flum ...

  7. 【翻译】Flume 1.8.0 User Guide(用户指南) Sink

    翻译自官网flume1.8用户指南,原文地址:Flume 1.8.0 User Guide 篇幅限制,分为以下5篇: [翻译]Flume 1.8.0 User Guide(用户指南) [翻译]Flum ...

  8. HAProxy + Keepalived + Flume 构建高性能高可用分布式日志系统

    一.HAProxy简介 HAProxy提供高可用性.负载均衡以及基于TCP和HTTP应用的代 理,支持虚拟主机,它是免费.快速并且可靠的一种解决方案.HAProxy特别适用于那些负载特大的web站点, ...

  9. flume学习笔记

    #################################################################################################### ...

随机推荐

  1. Redis和Memcache对比及选择(转载)

    原文地址:http://blog.csdn.net/sunmenggmail/article/details/36176029 没有必要过多的关注性能.由于Redis只使用单核,而Memcached可 ...

  2. CMMI分为哪几个等级?

    一共分为五个等级. 1.CMMI一级,完成级.在完成级水平上,企业对项目的目标与要做的努力很清晰.项目的目标得以实现. 2.CMMI二级,管理级.在管理级水平上,企业在项目实施上能够遵守既定的计划与流 ...

  3. C语言的函数声明,定义,调用以及exit退出

    #include <stdio.h> #include <stdlib.h> void singing(); int main() { singing(); system(&q ...

  4. 3DES加解密类

    using System; using System.IO; using System.Security.Cryptography; using System.Text; namespace GT.C ...

  5. buunctf@reverse2

  6. File类、FileInfo类、Directory类、DirectoryInfo类

    File类.Directory类,都是静态类,可以直接使用类名 FileInfo类.DirectoryInfo类,都是动态类,需要new对象,通过对象来操作 [文件的创建.复制.移动.删除]using ...

  7. 计蒜客 2018南京网络赛 I Skr ( 回文树 )

    题目链接 题意 : 给出一个由数字组成的字符串.然后要你找出其所有本质不同的回文子串.然后将这些回文子串转化为整数后相加.问你最后的结果是多少.答案模 1e9+7 分析 : 应该可以算是回文树挺裸的题 ...

  8. CF contest 1216 Div3. F

    题目链接:Click here Solution: 看起来是贪心,其实不然... 我们定义\(f[i]\)表示仅覆盖\(1\sim i\)所需要的最小代价,那么对\(i\)为0的点来说,易得\(f[i ...

  9. AcWing:138. 兔子与兔子(字符串Hash)

    很久很久以前,森林里住着一群兔子. 有一天,兔子们想要研究自己的 DNA 序列. 我们首先选取一个好长好长的 DNA 序列(小兔子是外星生物,DNA 序列可能包含 26 个小写英文字母). 然后我们每 ...

  10. Oracle11g RAC+DG搭建

    项目环境准备 3.1虚拟机配置 版本选择 注意Linux操作系统.此次项目我选择的版本是Oracle Enterprise Linux 5.4 内存的设置 本人电脑物理内存8G,由于此次实验要开三台虚 ...