1

I have a Joomla/Virtuemart installation and i want to create a master-slave replication with 1 slave The Slave will be used as a failover in case there is something wrong with the master.

The switching procedure of course will not be automatic as i will have to change the A records of the dns zone to the slave server. I also understand that if i want to use the master server again, i will have to setup the replication from the beggining.

To the question: If let's say the replication has been running for a year and i decide to switch to the slave server, will the slave be an exact copy of the master? Meaning will all data be intact or there's a chance that it won't be, since the replication is asynchronous?

Meni
  • 87
  • 7

1 Answers1

1

Answer is Yes, if there is no issues between master and slave. But MariaDB couldn't guarantee database consistency, because replication is asynchronous. To prevent such issues you should monitor replication state.

Alexander Tolkachev
  • 4,513
  • 3
  • 14
  • 23
  • could you please point on how can i do that? – Meni Sep 13 '19 at 16:15
  • @Meni, you could try to use [this article](https://www.percona.com/blog/2015/03/09/5-free-handy-tools-for-monitoring-and-managing-mysql-replication/) – Alexander Tolkachev Sep 13 '19 at 16:54
  • Thank you for this, i really appreciate it. too bad my reputation is low and i can't upvote your answer. – Meni Sep 16 '19 at 08:18
  • @ Alexander-Tolkachev the percona solution is too complicated for my needs, therefore i have created a bash script which emails the output of `show slave status\G;` on the slave on daily basis. do you believe that this method is efficient enough? – Meni Sep 26 '19 at 13:44
  • @Meni it depends on your needs. If it's okay for you, that's good. :) I will not like such approach, because in worst case I will have broken replication for one day. – Alexander Tolkachev Sep 27 '19 at 13:32