使用keepalived+haproxy搭建高可用服务器
环境 HAProxy: 1.4.18 KeepAlived: 1.2.2 VIP: 192.168.1.99 M: 192.168.1.222 S: 192.168.1.189 架构图 192.168.1.99 ±----------VIP----------+ | | | | Master Backup 192.168.1.189 192.168.1.222 ±---------+ ±---------+ | HAProxy | | HAProxy | |keepalived| |keepalived| ±---------+ ±---------+ | v ±-------±--------+ | | | | | | v v v ±-----+ ±-----+ ±-----+ | WEB1 | | WEB2 | | WEB3 | ±-----+ ±-----+ ±-----+ 安装HAProxy 安装pcre yum install pcre wget http://haproxy.1wt.eu/download/1.4/src/haproxy-1.4.18.tar.gz global maxconn 20480 #默认最大连接数 log 127.0.0.1 local3 #[err warning info debug] chroot /var/haproxy