haproxy服务器

该博客介绍了如何配置haproxy服务器作为负载均衡器,结合keepalived实现高可用。haproxy服务器节点包括192.168.79.150和192.168.79.160,它们分别负责调度到HTTP服务器WEB1(192.168.79.20)和WEB2(192.168.79.21)。同时,keepalived服务器也在192.168.79.150上运行,确保VIP地址192.168.79.10的高可用性。
摘要由CSDN通过智能技术生成

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 *:80
 64     acl url_static       path_beg       -i /static /images /javascript /
    stylesheets 65     acl url_static       path_end       -i .jpg .gif .png .css .js
 66 
 67    # use_backend static          if url_static
 68   !   use_backend static
 69    # default_backend             app

74 backend static   #通过backend关键字定义
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值