1

I am a newbie in software architecture and I have some question:

I don't understand which requests is sent to the HAProxy on this image.
I mean: if one "Application" Server (backend) want to save data in the Galera Cluster what is the request that will be sent to the HAProxy?
Is it an sql query "request"?
If it is an sql query should the HAProxy server needs a mysql-server to "handle" the connection?
Should Application Server needs to be configured to make an sql connection to the HAProxy?

from: https://fromdual.com/making-haproxy-high-available-for-mysql-galera-cluster enter image description here

Thanks!

Theo Cerutti
  • 779
  • 1
  • 10
  • 33

1 Answers1

2

The application only needs to know the IP address of the VIP in this architecture. The app connects to that VIP using a MySQL connector, as if it is a MySQL Server.

The "requests" are then stateful TCP/IP connections using the MySQL protocol, just as if the app were connected directly to a MySQL node.

This is not a series of stateless http requests. You might be assuming that HAProxy is only for load-balancing http requests. In fact, HAProxy can be used for other protocols than http.

Bill Karwin
  • 538,548
  • 86
  • 673
  • 828
  • Thanks! It seem clearer to me. One other question: is keepalived that creates the VIP? Or do I need to make it myself? – Theo Cerutti Dec 08 '21 at 20:02
  • 1
    Keepalived creates the VIP. As far as I know, it's up to you to choose an IP address on your subnet that is not already in use by other hosts. – Bill Karwin Dec 08 '21 at 21:00
  • Understood! Thanks!!! – Theo Cerutti Dec 08 '21 at 21:07
  • Another question, should a Galera Cluster MUST be in the same network? I mean is it possible to have one Galera node and another node in a completely different server?? thanks – Theo Cerutti Dec 15 '21 at 16:44
  • 1
    @TheoCerutti no, Galera does not have to be within the same network. As long as the hosts can reach each other via the appropriate ports it will work. – ruhnet Feb 22 '22 at 16:09