本文讲继续讲述LVS+keepalived实现负载均衡
一、本次搭建的系统架构图
- 虚拟机:VirtualBox
- virtaulbox host-only的IP地址:192.168.137.1
- 所用系统:CentOS7
- 真实web服务器(RS1):192.168.137.5
- 真实web服务器(RS2):192.168.137.6
- Master负载均衡服务器:192.168.137.101
- backup负载均衡服务器:192.168.137.102
- 系统对外虚拟IP:192.168.137.100
二、Keepalived的安装配置过程
两台负载均衡服务器上均需要安装、配置Keepalived
2.1 安装Keepalived
$ yum -y install keepalived
2.2 配置Keepalived
$ vim /etc/keepalived/keepalived.conf
配置信息如下
! Configuration File for keepalived
global_defs {
notification_email {
acassen@firewall.loc #设置报警邮件地址,可以设置多个,每行一个。
failover@firewall.loc #需开启本机的sendmail服务
sysadmin@firewall.loc
}
notification_email_from Alex