Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Single slave - multiple master MySQL replication

I need to replicate different MySQL databases from multiple servers into a single slave server. How can this be done? Do I need a separate MySQL instance on the slave for each master server? Or is there a way to define multiple master hosts?

We're basically using the slave as a hot backup for multiple websites. Should we be thinking about clustering instead of replication?

like image 499
HyderA Avatar asked Sep 25 '11 07:09

HyderA


1 Answers

Best way to achieve that would be a real backup solution... but when you do it the way you describe define one slave instance per master - this way you stay flexible, for example if any change is needed you could even move one or more of the slave instances to another machine without any influence on the other slaves/masters...

EDIT - as per comments:

For a description on how to setup multiple instances of MySQL on the same machine see for example

  • http://dev.mysql.com/doc/refman/5.1/en/multiple-servers.html
  • http://www.ducea.com/2009/01/19/running-multiple-instances-of-mysql-on-the-same-machine/
  • Multiple MySQL instances on a single machine

This keeps you even flexible enough to have different MySQL versions in parallel (identical per slave/master combination)...

like image 183
Yahia Avatar answered Oct 14 '22 19:10

Yahia