flume高可用-balance-配置文件编写
Flume 的负载均衡
负载均衡是用于解决一台机器(一个进程)无法解决所有请求而产生的一种算法。Load balancing SinkProcessor 能够实现 load balance 功能,如下图Agent1 是一个路由节点,负责将 Channel 暂存的Event 均衡到对应的多个 Sink组件上,而每个 Sink 组件分别连接到一个独立的 Agent 上,示例配置,如下所示:
在此处我们通过三台机器来进行模拟flume的负载均衡
三台机器规划如下:
node01:采集数据,发送到node02和node03机器上去
node02:接收node01的部分数据
node03:接收node01的部分数据
第一步:开发node01服务器的flume配置
node01服务器配置:
cd /export/servers/apache-flume-1.8.0-bin/conf
vim load_banlancer_client.conf
# agent name
a1.channels = c1
a1.sources = r1
a1.sinks = k1 k2# set gruop
a1.sinkgroups = g1# set channel
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100
a1.sources.r1.channels = c1
a1.sources.r1.type = exec
a1.sources.r1.command = tail -F /export/servers/taillogs/access_log# set sink1
a1.sinks.k1.channel = c1
a1.sinks.k1.type = avro
a1.sinks.k1.hostname = node02
a1.sinks.k1.port = 52020# set sink2
a1.sinks.k2.channel = c1
a1.sinks.k2.type = avro
a1.sinks.k2.hostname = node03
a1.sinks.k2.port = 52020# set sink group
a1.sinkgroups.g1.sinks = k1 k2# set failover
a1.sinkgroups.g1.processor.type = load_balance
a1.sinkgroups.g1.processor.backoff = true
a1.sinkgroups.g1.processor.selector = round_robin
a1.sinkgroups.g1.processor.selector.maxTimeOut=10000
第二步:开发node02服务器的flume配置
cd /export/servers/apache-flume-1.8.0-bin/conf
vim load_banlancer_server.conf# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1# Describe/configure the source
a1.sources.r1.type = avro
a1.sources.r1.channels = c1
a1.sources.r1.bind = node02
a1.sources.r1.port = 52020# 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
第三步:开发node03服务器flume配置
node03服务器配置
cd /export/servers/apache-flume-1.8.0-bin/conf
vim load_banlancer_server.conf
# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1# Describe/configure the source
a1.sources.r1.type = avro
a1.sources.r1.channels = c1
a1.sources.r1.bind = node03
a1.sources.r1.port = 52020# 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
第四步:准备启动flume服务
启动node03的flume服务
cd /export/servers/apache-flume-1.8.0-bin
bin/flume-ng agent -n a1 -c conf -f conf/load_banlancer_server.conf -Dflume.root.logger
启动node02的flume服务
cd /export/servers/apache-flume-1.8.0-bin
bin/flume-ng agent -n a1 -c conf -f conf/load_banlancer_server.conf -Dflume.root.logger
启动node01的flume服务
cd /export/servers/apache-flume-1.8.0-bin
bin/flume-ng agent -n a1 -c conf -f conf/load_banlancer_client.conf -Dflume.root.logger
第五步:node01服务器运行脚本产生数据
cd /export/servers/shells
sh tail-file.sh
flume高可用-balance-配置文件编写相关推荐
- flume高可用-failover-模型分析
高可用方案 在完成单点的Flume NG搭建后,下面我们搭建一个高可用的Flume NG集群,架构图如下所示: 角色分配 Flume的Agent和Collector分布如下表所示: 名称 HOST 角 ...
- flume高可用-failover-配置文件编写
Node01 安装和配置 将node03机器上面的flume安装包以及文件生产的两个目录拷贝到node01机器上面去 node03机器执行以下命令 cd /export/servers scp -r ...
- flume高可用-balance-测试运行
- mysql高可用集群MHA,PXC
MHA+MYSQL主从同步结构 MHA由日本dena公司youshimaton开发 是一套优秀的实现mysql高可用的解决方案 数据库的自动故障切换操作能做到在0-30秒内完成 MHA能确保在故障切换 ...
- Mysql的高可用架构搭建(MHA)
文章目录 Mysql高可用架构(MHA)简介 MySQL高可用系统 MHA技术介绍 MHA提供了如下功能 MHA工作原理 MHA的优点 MHA组件介绍 Manager工具包主要包括以下工具 Node工 ...
- keepalived(haproxy高可用、haproxy高可用双主、lvs+keepalived)
LAN客户端判定哪个路由器应该为其到达目标主机的下一跳网关的方式有动态及静态决策两种方式,其中,常见的动态路由发现方式有如下几种: 1.Proxy ARP -- 客户端使用ARP协议获取其想要到达的目 ...
- 企业级Nginx负载均衡与keepalived高可用实战课-老男孩-专题视频课程
企业级Nginx负载均衡与keepalived高可用实战课-2678人已学习 课程介绍 企业级Nginx负载均衡与keepalived高可用实战分享 课程收益 互联网环境最常用 ...
- 日志采集框架Flume以及Flume的安装部署(一个分布式、可靠、和高可用的海量日志采集、聚合和传输的系统)...
Flume支持众多的source和sink类型,详细手册可参考官方文档,更多source和sink组件 http://flume.apache.org/FlumeUserGuide.html Flum ...
- HAProxy + Keepalived + Flume 构建高性能高可用分布式日志系统
一.HAProxy简介 HAProxy提供高可用性.负载均衡以及基于TCP和HTTP应用的代 理,支持虚拟主机,它是免费.快速并且可靠的一种解决方案.HAProxy特别适用于那些负载特大的web站点, ...
最新文章
- 训练不出结果_智能训练仪:专业化智能防控近视训练设备
- Mysql之外连接_OUTER JOIN
- 赴马来西亚旅游遇车祸 70岁中国籍老人不幸身亡
- python前端接口_Python接口自动化——Web接口
- 认证授权方案之授权揭秘 (上篇)
- linux网络状态检测libcurl,使用curl进行网络诊断 - msnshow的个人空间 - 51Testing软件测试网 51Testing软件测试网-软件测试人的精神家园...
- Spring Session + Redis实现分布式Session共享
- 3 二分频verilog与Systemverilog编码
- 编写高质量代码的十个秘诀(转)
- docker安装消息队列延时插件
- Android错误:无法在设备上安装* .apk *:超时
- Sudo环境变量继承
- excel中vlookup函数的使用方法_Excel中Vlookup——从入门到放弃
- axis2 wsdl2java 工具_Axis2中的工具wsdl2Java
- Monkey压力测试
- Windows10C盘文件简单介绍
- 免费下载C++Prime!
- 读书记录|《所罗门王的指环》
- 每天一个linux命令(33):atq命令
- java: 读取D:\repository\org\lz4\lz4-java\1.7.1\lz4-java.jar时出错; error in opening zip file解决方案