lvs+keepalived+nginx搭载高性能负载均衡
1. 配置网络结构: 192.168.1.11和192.168.1.12是互为备份的LVS Director, 192.168.1.11默认为MASTER, 192.168.1.12为BACKUP 192.168.1.99是LVS Director的虚拟IP,当192.168.1.11正常工作时,它会通过VRRPv2协议向广播网段发送ARP数据包,声明192.168.1.99为其所有,当192.168.1.11宕机时,192.168.1.12会立即接管该工作,声明192.168.1.99的所有权并响应用户请求 192.168.1.13和192.168.1.14是 Real Server, 上面有监听在80端的Web 服务 2. Keepalived主机安装配置 1. 在192.168.1.11和192.168.1.12上安装keepalived, 安装完成后修改配置文件/etc/keepalived/keepalived.conf。 # yum install keepalived -y # vi /etc/keepalived/keepalived.conf 详细配置参数说明请参见官方文档: http://www.keepalived.org/doc/configuration_synopsis.html 2. 配置MASTER节点(192.168.1.11),配置文件内容如下