Setup HAProxy with two backend MySQL - Server with a "MySQL compatible" configuration. That is the hardest part, because if I remember correctly the default config is not compatible and will blocked by mysql server.
HAProxy automatically switch Database to other server if there is a problem only with database. (If you wants to have full server replication, you maybe don't need HAProxy)
Real problem is the step back to Live system, because for this the old "Live" must be configured as "Slave" to get all records, before you could switch back.
For me only the files was a problem to replication correctly and I don't wanted to spend more time in this topic. I used replication only for fallback option of database during updates.
In the meantime filesystems, which automatically replicate are a lot better. But now I don't need it anymore.
At all I must say, currently I'm not using this setup anymore, because it don't runs smoothly during updates. And on some point between Debian 8 and Debian 9 I lost the slave ;)