Slave2Master election, with existing slave in a different AZ

LoreLLo's Avatar

LoreLLo

02 Sep, 2016 03:59 PM

From the docs it's not clear to me what happens in this specific case, I suppose that this happens:
1) the master record is removed from DNS
2) a snapshot of the volume on the master is taken and a new volume is created in the slave AZ
3) the new volume it's attached to the slave and mysql restarted as master on the new data volume.
4) the master record is created for the new master
5) all slaves are reconfigured to point to the new master
6) a snapshot is taken from the new master

During steps 1, 2 & 3 all writes obviously fails.

Is this correct?

Does something happens to the volume of the died master or the original volume of the elected-slave?

  1. Support Staff 1 Posted by Marat Komarov on 05 Sep, 2016 09:03 AM

    Marat Komarov's Avatar

    inline

    During steps 1, 2 & 3 all writes obviously fails.

    Yes, it's right

    Does something happens to the volume of the died master or the original volume of the elected-slave?

    Volume still exists on a cloud, as a recovery data point for the user.

    Regards,
    Marat

  2. 2 Posted by LoreLLo on 05 Sep, 2016 09:05 AM

    LoreLLo's Avatar

    Thanks Marat,
    L

  3. LoreLLo closed this discussion on 05 Sep, 2016 09:05 AM.

  4. LoreLLo re-opened this discussion on 23 Jun, 2017 01:10 PM

  5. 3 Posted by LoreLLo on 23 Jun, 2017 01:17 PM

    LoreLLo's Avatar

    Hi Marat, sorry for reopening this discussion, but a doubt come to my mind.

    I've a notice from AWS that a maintenance has been scheduled on the host where my mysql master resides, so I want to reduce the downtime switching the master role to another host.
    Can you confirm me that:
    1. to force an election of a new master I've to terminate the instance of the mysql master
    2. the best way to reduce the downtime is to create a slave in the same AZ of the master, so that Scalr can quickly attach the existing volumes of the old master to this slave and elect it as the new master

    Thanks in advance,
    L

  6. Support Staff 4 Posted by Marat Komarov on 23 Jun, 2017 06:27 PM

    Marat Komarov's Avatar

    LoreLLo,

    The steps look good. Also please stop mysqld on Master before terminating it, to avoid innodb recovery

    Regards,
    Marat

  7. 5 Posted by LoreLLo on 26 Jun, 2017 08:15 AM

    LoreLLo's Avatar

    Thanks Marat,
    I've now a Mysql Slave in the same AZ of the current master, how much time should take the termination of the master and the election to master of the slave?

    Is there anything else that we should do to reduce the downtime?

  8. Support Staff 6 Posted by Marat Komarov on 26 Jun, 2017 11:23 AM

    Marat Komarov's Avatar

    Scalr initiates Slave promotion immediately, as it sees Master server terminated on a cloud. Volume re-attach and mysqld reconfiguration usually takes 1-2 minutes.

    But other Slaves will be pointed to the new Master only after new binary snapshot completion, which in your case (RAID0 on 1Tb EBS) may take from 10 minutes up to an hour.

    Marat.

  9. LoreLLo closed this discussion on 27 Jun, 2017 07:35 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac