MySQL Forums
Forum List  »  Replication

Re: Removing dead server from replication ring
Posted by: Geoff Kuenning
Date: May 23, 2018 02:46PM

I found a simple solution: the CHANGE MASTER TO command. On C, I did CHANGE MASTER TO MASTER_HOST = 'A.example.com'; What that did was somewhat different from what I expected, although in the end it worked. What I expected was that C would start reading A's logs from whereever it had left off on B. Instead, it started reading A's logs from the oldest, which was a bit of a nuisance for two reasons: first, I had never done a PURGE BINARY LOGS so there were a lot of them and so the replay took a while. Second, when it ran into a duplicate INSERT it stopped. I resolved the latter by temporarily changing my.cnf on C to contain slave-skip-errors = 1062, as detailed here: http://www.ducea.com/2008/02/13/mysql-skip-duplicate-replication-errors/

After making that change and waiting for a while, the replay finished, C caught up with A, and I then removed the slave-skip-errors line and restarted the server.

This approach is described in the mysql documents; I didn't save the URL but search for "failover" as the magic term. I should note for others who try it that in my setup we only use INSERT and DELETE commands; we don't tend to use UPDATE. So I can't guarantee that you'll get the same results if you use UPDATEs.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Removing dead server from replication ring
413
May 23, 2018 02:46PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.