0

I have 2 MySQL/MariaDB servers each of them with its own database and I would like to set up a continuous backup on each other via replication.

Is it possible to make 1 DB master and 1 slave on each one of the servers?

Server 1         Server 2

db1 (master)     db1 (slave)
db2 (slave)      db2 (master)

Or is there a better option to do it? But I would like to have ready-to-use DB(no dump files) in case of a failure of one of the servers so I can quickly switch to another.

Eugene
  • 119
  • 5
  • 1
    Start with db1 master + slave - "easy binlog replication" then do it the other way around. If the do not have conflicting databases or users, you could even run master+slave in same instance. – NiKiZe Aug 12 '21 at 06:01
  • 1
    Sure you could do that. I'm a bit surprised that you didn't just do it. What is the problem you are having? – Michael Hampton Aug 12 '21 at 12:11
  • 2
    Your specific use pattern is abnormal but feasible. Search for "dual master" or "master-master". – Rick James Aug 12 '21 at 17:08
  • @NiKiZe I see, so its like master-master but with different options in `binlog_do_db`, thanks, I set it up! – Eugene Aug 18 '21 at 15:27
  • @RickJames I've heard about it, and after setting up I realized I can set different `binlog_do_db` values on each server so it will be exactly like I wanted! Thanks! – Eugene Aug 18 '21 at 15:28

0 Answers0