I'm setting up a high availability LAMP stack - so far, I have two servers with HAProxy running on both their frontends that own a floating IP. HAProxy redirects requests to backend Apache servers running on each of them (same machine, port 8000).

This all works, and I'm happy with this so far for high availability. I have yet to deal with the databases yet however.

Since I only have two servers, I don't think I can do master-master like Galera cluster due to the requirement of quorum. So, I planned to do master-slave read only replication.

Most of the guides I see online don't mention the MaxScale proxy that MariaDB suggests in its high availability guide (page 4 for example)

I'm just really confused overall on what to do and how to set it up?

From my perspective, I'd like to set up a MaxScale proxy on one of my servers and run MariaDB on both servers; MaxScale will handle things like redirects. How can I actually accomplish what I'm looking for?

  • MaxScale is MariaDB specific. It basically sites in front of your DB servers and is where are the queries are directed to and it routes it to the appropriate DB server based on it's rules. In a two server setup, writes would be directed to the master, then replicated to the slave and reads would either happen on both servers or one server depending on your proxy setup. I think their guide covers your scenario at a glance.
    – DubStep
    Commented Aug 21, 2020 at 19:03
  • You cannot get full HA with only 2 servers. What are you willing to sacrifice? Auto-failover is essentially not possible. See MHA for slightly better HA.
    – Rick James
    Commented Aug 22, 2020 at 22:41
  • I assume that split brain won't happen - even if it does, it won't be completely destructive in my case either and will only cause some loss of data @DubStep if I do that, what happens if MaxScale goes down? Do I need to run a complete VIP setup?
    – forkwasher
    Commented Aug 26, 2020 at 19:00
  • If MaxScale goes down, you lose database connectivity. But you should run that in a load balanced way as well. TBH, with two servers, you are probably best with skipping MaxScale. You should have at least 3 masters when using it. Like Rick James said, auto-failover is pretty much not an option with two servers, so your benefits vs. complexity make it not worth it.
    – DubStep
    Commented Sep 2, 2020 at 17:45


You must log in to answer this question.

Browse other questions tagged .