Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Very trick task to find a good title for this question, but here goes the q:

I have a few development machines, where I develop my PHP applications on, and testing via a local webserver.

This works out pretty well for each machine. However, I would like to replicate the DB from my machines to a central location.

So, to sum up:

DEV1 -> CENTRAL
DEV2 -> CENTRAL
DEV3 -> CENTRAL
CENTRAL -> DEV1
CENTRAL -> DEV2
CENTRAL -> DEV3

I hope this makes sense, as I cannot find an easy way to tell it.

Basically, it is a 2-way replication, where all 4 databases contain the same info, and each of them can be updated locally, to then be pushed out to the others.

Is this actually doable?

All my dev machines are running Windows 7, and my central DB server is running CentOS 6.

share|improve this question

3 Answers 3

up vote 0 down vote accepted

You could go with Percona XtraDB Cluster

I am currently evaluating it and I think it is brilliantly designed for MultiMaster writes. It can use mysqldump (default), rsync, and xtrabackup (preferred) for initializing new Cluster node. You have total freedom and power. This may be the greatest cliche of all time but WITH GREAT POWER, THEIR MUST ALSO ALWAYS BE GREAT RESPONSIBILITY (19:16 - 19:25 of the Video).

I discussed this as one of many options for cross-datacenter replication in the DBA StackExchange : http://dba.stackexchange.com/questions/22788/best-solution-for-cross-datacenter-mysql-master-slave-replication/22790#22790

share|improve this answer
    
This sounds like the best solution, though, I decided to move away from the multi-master-setup. –  Frederik Nielsen Sep 19 '12 at 17:39

@Frederik Nielsen, yes, it is possible to have multiple slave MySQL instances for each master MySQL instance.

However, note that each slave can only replicate from one master. So two-way (or quadruple way) replication is not really possible in your original setup, but I think the idea of one master with 4 slaves might be a good solution.

share|improve this answer
    
Thanks for your answer, and will also be what I choose to do. Rolando's answer, however, was the correct one for my original question. –  Frederik Nielsen Sep 24 '12 at 15:19

Looks like you want multi-master replication which has been supported for a little while in MySQL.

share|improve this answer
    
Sounds quite right. Is it just something I setup via fx phpmyadmin? –  Frederik Nielsen Sep 5 '12 at 12:16
    
No, running circular master replication gets very VERY complicated when you have more than 2 nodes. For more nodes you need to use a non circular erplicator such as Percona or Tungsten. –  symcbean Sep 5 '12 at 12:16
    
Hmm allright.. Maybe I should just go for a single MySQL DB, and then let the others connect to it. Is it possible to have 1 master, that replicates out to several others? Then I would just do the changes on the master, and then I can use the local DB when I got no internet connectivity. –  Frederik Nielsen Sep 5 '12 at 12:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.