MySQL Replication – Read-Only Replication Setup

MySQLreplication

I've multiple linux servers which runs MySQL server and my applicaiton each.

I have a cron job which creates daily backups and uploads them to another server. Daily backups are OK but, i want to be able to recover the current state of the database in case of the server goes down or whatever happens.

Can I create a single "read only async replication server" and configure all other servers to create replications to that server?

OR, what is the right way to do that?

Best Answer

It depends on the version.

Look for "multi-source" replication. This is where multiple Primaries can replicate to a single Replica. But this does not say how you would restore a single Primary that dies.

Consider using a single Primary for everything, then have one (or more) Replicas.

Or you could have multiple Primary-Replica pairs sitting in VMs or Dockers. The pair would, of course, have its parts on separate machines, preferably geographically separated (think storms, earthquakes, etc).