I've just setup MariaDB on Ubuntu VMs with Master-Master replication using a combination of these three guides:
- http://www.chriscouture.com/setting-up-replication-on-mariadb/
- https://www.server-world.info/en/note?os=Ubuntu_16.04&p=mariadb&f=3
- https://www.digitalocean.com/community/tutorials/how-to-set-up-mysql-master-master-replication
In short, both are masters and both are slaves to the other one. This will be used by separate web hosting servers. One will be "primary master" which all web servers connect to, and in case of a failure on that server they will be manually changed to the "secondary master".
The reason I went for this instead of Master-Slave is
- The 3rd party backup job is simpler. Both backups and restores are done on the "secondary" master, instead of backup from the secondary and restoring to the primary.
- If the primary fails and I have to switch to the secondary for a while, all changes made during that time should be written to the primary when it comes online again (?).
It's not live yet but everything works fine so far when I'm testing it. However I'm no DBA. I've been reading about how it's not "worth it" and if you don't absolutely need the Master-Master you should go with Master-Slave. Now I'm afraid I will run into problems like inconsistencies and other headaches. A maximum of about 100 databases for mostly Wordpress installations will be hosted.
What are your thoughts on the matter? M-M or M-S? If M-S, how do I "sync back" data changed if the Master goes down and the Slave need to be the active server for a period of time?
I'm also wondering if there's a standard, generally accepted, step-by-step way to upgrade these. I'm thinking when a OS or MariaDB version upgrade is needed. My general thoughts are something like take down one server, upgrade it, start it. Then take down the other, upgrade it, start it. But I'm guessing there's more to it than that.
I only found some documentation on M-S upgrading with Mysql.