keepalived + haproxy + apache (web de equilibrio de carga de alta disponibilidad)
alrededores
Cuatro: CentOS Linux versión 7.5.1804 (Core)
- 192.168.153.179 keepalived haproxy (maestro)
192.168.153.178 keepalived haproxy (respaldo)
192.168.153.177 httpd (web1)
192.168.153.176 httpd (web2)
firewall y selinux cerrado
Iniciar operación
- instalación
Instalar según el medio ambiente
yum -y install keepalived haproxy
yum -y install httpd
MASTER BACKUP fin de operación: keepalived
Si no sabe qué cambiar, haga clic en
vim /etc/keepalived/keepalived.conf
MASTER BACKUP fin de operación: haproxy
Ambos lados operan exactamente igual
vim /etc/haproxy/haproxy.cfg
systemctl start haproxy
operación web (1, 2): httpd
El servidor web2 puede cambiar la página a web
echo web1 > /var/www/html/index.html
systemctl start httpd