本文主要是介绍haproxy服务器,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
haproxy服务器1:192.168.79.150
haproxy服务器2:192.168.79.160
WEB1(http服务器):192.168.79.20
WEB2(http服务器):192.168.79.21
keepalived服务器:192.168.79.150
VIP 192.168.79.10
httpd WEB1,2服务器
yum -y install httpd
systemctl start httpd
cd /var/www/html
vim index.html
WEB1:a
WEB2:b
haproxy1服务器:
yum -y install haproxy[root@localhost haproxy]# haproxy -v
HA-Proxy version 1.5.18 2016/05/10
Copyright 2000-2016 Willy Tarreau <willy@haproxy.org>vim /etc/haproxy/haproxy.cfg
frontend main *:8064 acl url_static path_beg -i /static /images /javascript /stylesheets 65 acl url_static path_end -i .jpg .gif .png .css .js66 67 # use_backend static if url_static68 ! use_backend static69 # default_backend app74 backend static #通过backend关键字定义
这篇关于haproxy服务器的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!