1

We have right now one server with a database. A device and a website are accessing that database causing load

What I want is to create two servers master-slave where master databases are replicated to slave but slave have some databases that must not be in master database.

Is it possible to do it using master-slave replication or using master-master replication?

  • Sure it's possible with master-slave. Check out the options --binlog-ignore-db and --replicate-wild-ignore-table, documented here and here. – WAF Dec 17 '15 at 12:02
0

You do not want writes to be replicated from A to B then A better be slave of B, master.

again, to complicate things you can use master-master with replication filters but let's not get there if you do-not wish to.

That said, writing on slave is sort of risky business where you're going to "accidentally" write on databases being replicated from master and that's not good! As long as you're making sure you're only writing to slave-only databases it should be fine. You should choose to create dedicated users for such activity. You might also want to wonder: - What about backups of master data? - What about backups of slave data?

just saying... but yea to answer your question go with master-slave.

  • But isn't it going to create a conflict ? Because I read that any changes in slave should be synced with master else it can cause errors – MIC Dec 17 '15 at 19:01
  • or putting binlog-ignore-db in master will ignore those db's in slave! also I have heard that master master replication is very dangerous to use! – MIC Dec 17 '15 at 19:15
  • 1st comment: Very first thing is you should not change on "slave" when you're calling it a slave. If you're intended to make changes on slave then either it's wrong or you want to make it master. Btw share the source which says "changes on slave should be synced with master" – mysql_user Dec 18 '15 at 5:36
  • 2nd comment: Replication filters are to be used carefully... Read the working of replication filters on documentation and then compare binlog-ignore-db and replicate-do-db !! - It's too complex to fix data discrepancies while you write on both masters and hence it should be avoided. – mysql_user Dec 18 '15 at 5:40
  • But when I'm making a database in slave that is not in master isn't it a wrong approach as well? if both the approaches are not good then what should I do? here is the link dba.stackexchange.com/questions/44431/… – MIC Dec 18 '15 at 6:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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