1 Star 0 Fork 36

xh / haproxy

forked from src-openEuler / haproxy 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
tmp 2.32 KB
一键复制 编辑 原始数据 按行查看 历史
xh 提交于 2024-04-29 06:51 . update tmp.
每个机器的ip地址:
1、The ip address of each machine:
client ip: 19.182.211.230
haproxy server ip:
eth0 19.182.251.91
eth1 19.182.173.96
http server ip: 19.182.182.149
2、haproxy server config:
echo '19.182.182.149 web1' >> /etc/hosts
cat /etc/haproxy/haproxy.cfg
global
log 127.0.0.1 local0
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
daemon
maxconn 4000
defaults
mode http
log global
option httplog
retries 3
option dontlognull
option redispatch
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
maxconn 3000
default-server source 19.182.173.96 interface eth1
frontend main
bind *:80
default_backend http_back
backend http_back
balance roundrobin
server web1 19.182.182.149:80 cookie node1 check
3、19.182.182.149 http server config:
启动80端口http服务(Start the http service on port 80 in the background)
python3 -m http.server 80&
echo '19.182.251.91 haproxy_server' >> /etc/hosts
4、client config(add haproxy service map):
echo '19.182.251.91 haproxy_server' >> /etc/hosts
#The above is configured to access the haproxy service via curl
curl haproxy_server
<html><body><h1>503 Service Unavailable</h1>
No server is available to handle this request.
</body></html>
b7ff822合入后,配置了一个简单haproxy服务,'interface'参数生效('source' subargument),连接不到http服务器,但eth0不会报错。
After b7ff822 merged in, configured a simple haproxy service with the 'interface' parameter in effect ('source' subargument), can't connect to the http server, but eth0 doesn't report errors.
我测试了每个haproxy版本(2.6~2.9)(修复了b7ff822),一样的错误
I tested every haproxy version (2.6~2.9) (fixed b7ff822), same error
journalctl -xfu haproxy
Apr 29 14:28:25 haproxy_server haproxy[33180]: [WARNING] (33180) : Server http_back/web1 is DOWN, reason: Layer4 timeout, check duration: 2002ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
Apr 29 14:28:25 haproxy_server haproxy[33180]: [ALERT] (33180) : backend 'http_back' has no server available!
1
https://gitee.com/xinghe_1/haproxy.git
git@gitee.com:xinghe_1/haproxy.git
xinghe_1
haproxy
haproxy
master

搜索帮助