centos6.6 LVS+keepalived
2015-12-31 10:12
543 查看
之前有写过keepalived+mysql 和lvsDR模式的分析篇。然而LVS没有写高冗余。今天来写一篇LVS+keepalived的
LVSDR只负责转发,LVS也没有nginx后端检查功能,所以后端realserver 宕机了,LVS还是会转发到后端去的。so 我们需要一个检查后端的功能,并剔除or增加。那这个任务就交给keepalived了
LVS安装 和keepalived 安装这里就不多说,
keepalived 安装请看:http://www.cnblogs.com/shiyiwen/p/5045027.html
LVSDR安装请看:http://www.cnblogs.com/shiyiwen/p/5069901.html
上拓扑
这里 37 为 master 161位backup
37-master keepalived.conf配置如下
161 BACKUP -keepalived.conf 如下
至于排错,大家有问题,可留言~
LVSDR只负责转发,LVS也没有nginx后端检查功能,所以后端realserver 宕机了,LVS还是会转发到后端去的。so 我们需要一个检查后端的功能,并剔除or增加。那这个任务就交给keepalived了
LVS安装 和keepalived 安装这里就不多说,
keepalived 安装请看:http://www.cnblogs.com/shiyiwen/p/5045027.html
LVSDR安装请看:http://www.cnblogs.com/shiyiwen/p/5069901.html
上拓扑
这里 37 为 master 161位backup
37-master keepalived.conf配置如下
! Configuration File for keepalived global_defs { notification_email { 907765003@qq.com } notification_email_from 907765003@qq.com smtp_server 127.0.0.1 smtp_connect_timeout 30 router_id LVS_DEVEL } # VIP1 vrrp_instance VI_1 { state MASTER interface eth0 lvs_sync_daemon_inteface eth0 virtual_router_id 51 priority 100 advert_int 5 # nopreempt authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { 192.168.0.36 } } virtual_server 192.168.0.36 80 { delay_loop 6 lb_algo wrr lb_kind DR # persistence_timeout 60 protocol TCP real_server 192.168.0.38 80 { weight 100 TCP_CHECK { connect_timeout 10 nb_get_retry 3 delay_before_retry 3 connect_port 80 } } real_server 192.168.0.162 80 { weight 100 TCP_CHECK { connect_timeout 10 nb_get_retry 3 delay_before_retry 3 connect_port 80 } } }
161 BACKUP -keepalived.conf 如下
! Configuration Filefor keepalived global_defs { notification_email { 907765003@qq.com } notification_email_from 907765003@qq.com smtp_server 127.0.0.1 smtp_connect_timeout 30 router_id LVS_DEVEL } # VIP1 vrrp_instance VI_1 { state BACKUP interface eth0 lvs_sync_daemon_inteface eth0 virtual_router_id 51 priority 90 advert_int 5 authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { 192.168.0.36 } } #REAL_SERVER_1 virtual_server 192.168.0.36 80 { delay_loop 6 lb_algo wlc lb_kind DR persistence_timeout 60 protocol TCP real_server 192.168.0.38 80 { weight 100 TCP_CHECK { connect_timeout 10 nb_get_retry 3 delay_before_retry 3 connect_port 80 } } #REAL_SERVER_2 real_server 192.168.0.162 80 { weight 100 TCP_CHECK { connect_timeout 10 nb_get_retry 3 delay_before_retry 3 connect_port 80 } } }
至于排错,大家有问题,可留言~
相关文章推荐
- linux下软件安装
- Linux环境编程导引
- Linux系统目录结构
- Centos 下Kafka集群的搭建
- Centos 下Storm集群的搭建及Java客户端环境
- Linux性能分析的前60000毫秒
- 修改Linux内核参数和用户资源参数
- Linux环境下安装部署AWStats日志分析系统
- linux内核驱动01-helloworld
- CentOS 7 安装mysql
- centOS下快速安装FFMPEG
- How I came to find Linux
- linux常用命令(二)
- Linux 动态链接库的编译和使用实例
- linux系统分区与挂载
- Linux下动态库so的生成与使用
- Linux配置
- Ubuntu15.10_64位安装Theano+cuda7.5详细笔记
- window与linux文件传输工具
- 在 Linux 终端下看《星球大战》