HAProxy community

Running MYSQL and Web Server load balancing 503 Error


Hope somebody can help I have run out of idea’s :frowning:

Is it possible to run mysql cluster load balancing and https load load balancing on the same instance of haproxy ?

I have the following setup but I receive 10 minutes delay on the application when one of the mysql servers is shutdown I receive 503 error . If I manually restart the haproxy service the application comes back online

Cluster Application ( 2 Nodes )
MYSQL Cluster (2 Nodes )
Keepalive Virtual IP

The application connects to the virtual IP for the database cluster and application

I think I have configured the haproxy frontend or backend incorrectly
Any help would be much appreciated


frontend http_front
mode http
bind *:80
bind *:443 ssl crt /etc/ssl/certs/mycert.pem
stats uri /haproxy?stats
default_backend http_back

backend http_back
mode http
balance roundrobin
cookie JSESSIONID prefix nocache
option forwardfor
option httpchk HEAD / HTTP/1.1\r\nHost:localhost
server FQDN cookie App1 check
server FQDN10.40.3.171:8080 cookie App2 check
http-request set-header X-Forwarded-Port %[dst_port]
http-request add-header X-Forwarded-Proto https if { ssl_fc }


You need to setup Galera Cluster for MySQL and making local connection from your web application.