飞道的博客

hproxy安装部署之超简单

524人阅读  评论(0)

keepalived+haproxy+apache(高可用负载均衡web)

环境

四台:CentOS Linux release 7.5.1804 (Core)

  • 192.168.153.179 keepalived haproxy (master)
    192.168.153.178 keepalived haproxy (backup)
    192.168.153.177 httpd (web1)
    192.168.153.176 httpd (web2)
    防火墙和selinux关闭

开始操作

  • 安装

根据环境内容安装即可

yum -y install keepalived haproxy
yum -y install httpd
MASTER BACKUP端操作:keepalived

如果不清楚更改项,参考点击

vim /etc/keepalived/keepalived.conf


MASTER BACKUP端操作:haproxy

双方操作完全一样

vim /etc/haproxy/haproxy.cfg 
systemctl start haproxy

web(1、2)操作:httpd


web2服务器将页面更改为 web即可

echo web1 > /var/www/html/index.html
systemctl start httpd
测试访问即可

到此结束~ _ ~

转载:https://blog.csdn.net/qq_49296785/article/details/109340205
查看评论
* 以上用户言论只代表其个人观点,不代表本网站的观点或立场