Can a MySQL database which is doing master-slave replication to a number of slaves be configured to do master-master replication to a new server at the same time?

I have an application that has a main database (master1) and a number of front-end servers, each with a local slave database (slave1...n). These are doing filtered replication, filtering on slave with replicate-do-db and replicate-wild-ignore-table.

I'm trying to find a way to upgrade the master database without downtime. I need you to review and possibly confirm that the following would work.

  1. Configure new server (master2) and import data from master1.
  2. Turn on master-master replication so master2 replicates everything from master1
  3. On each front-end server, change master to master2
  4. Switch DNS record for main database from master1 to master2
  5. Take down master1

Is this possible? Is there anything I should be paying attention to?

  • Please edit your question to use "server" for a piece of hardware that is running MySQL. Keep "database" for a collection of data within such a server. I think you are confusing "server" and "database". – Rick James Feb 8 '17 at 2:53
  • Probably the answer is 'yes', but I want you to clarify -- in case you are talking about filtering replication at the database level via binlog/replicate_do/ignore_db. – Rick James Feb 8 '17 at 2:54
  • @RickJames Thanks, updated question. No binlog_* configuration is used. – marekful Feb 8 '17 at 13:01

Your Answer

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

Browse other questions tagged or ask your own question.