0
我可能会使用错误的术语进行搜索,但我无法通过HAProxy完成与后端服务器的连接。我能够最初登录到服务器,但是应用程序也通过另外两个端口进行通信。我可以直接进入其中一台服务器,并登录并正确执行应用程序。然而,通过HAProxy,我可以进行身份验证,然后出现通信错误。我在考虑HAProxy没有通过其他端口上的数据。这怎么能实现?HAProxy Multiport后端
我的设置:连接到2个相同VM服务器
2 HAProxy的服务器。 HAProxy似乎正在正确地工作,只要告诉mcahines上的服务何时运行。它正在通过8443端口的认证。但是,就这一点而言。它不会启动使用端口3000和5432的VM。有关HAProxy设置的任何想法?
这里是我的配置文件:
global
ssl-server-verify none
tune.ssl.default-dh-param 2048
maxconn 256
defaults
log global
mode http
option httplog
option dontlognull
retries 3
option redispatch
timeout connect 5000
timeout client 10000
timeout server 10000
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
listen vm-port-3000
bind *:5432
server qvd4 10.0.0.1:3000
server qvdnode02 10.0.0.2:3000
listen vm-port-5432
bind *:5432
server qvd4 10.0.0.1:5432
server qvdnode02 10.0.0.2:5432
listen stats
bind :1936
stats enable
stats hide-version
stats realm Loadbalanced\ Servers
stats uri /haproxy?stats
stats auth haproxy:haproxy
frontend vm-initial-conn
bind *:8443 ssl crt /etc/ssl/certs/qvd/haproxy.pem
default_backend vmConn
backend vmConn
option forwardfor
option httpchk GET /qvd/ping HTTP/1.1
http-check expect status 200
balance roundrobin
http-request add-header X-Forwarded-Proto https if { ssl_fc }
http-request set-header X-Forwarded-Port %[dst_port]
server qvd4 10.0.0.1:8443 ssl verify none check
server qvdnode02 10.0.0.2:8443 ssl verify none check
其实,我不认为这跟不同的港口有什么关系。出于某种原因,HAProxy会超时。仍在调查。 –