我有一个部署在tomee服务器上的应用程序。为了对请求进行负载平衡,我们使用“ roundrobin”算法配置HAProxy。 但我无法使用此算法登录我的应用程序。在登录页面中,输入应用程序登录凭据后,它将重定向到同一登录页面。日志中没有错误。如果我将算法更改为“source”,我们就可以登录到应用程序。以下是HAProxy配置:
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
user haproxy
group haproxy
daemon
nbproc 1
stats socket /var/lib/haproxy/stats
defaults
mode http
log global
option httplog
option dontlognull
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
frontend abc-virtual
bind 1.2.3.4:1111
default_backend abc-servers
backend abc-servers
balance roundrobin
mode http
stats enable
stats uri /haproxy?status
server abc-qa-server1 1.2.3.4:8080 check weight 40
server abc-qa-server2 1.2.3.5:8080 check weight 40
答案 0 :(得分:0)
是的,您只能使用“ source”而不是roundrobin。