Is there a way to promote a HA Slave to Master (master is gone)
-
Hello,
as subject describes iam in a situation where the master is long gone, and I have been living with the slave for a while (lot of changes done - slave only)
is there a way to bring up a new master and get all changes replicated over? - or
is there a way to promote the current slave to master and then create a new slave? - or
what do the community recommend me to do? -
Could I take full backup of slave, do some tweaks in backup file - and restore that as a master on a fresh install maybe…. just thinking loud... ;D
-
I've never done it, but I don't see why you couldn't build a new slave box and set the old slave to XMLRPC Sync to it.
-
If that is what you really need to do, I would back up the secondary then restore the backup of the primary on the secondary and eat the downtime.
Then, when you get the hardware replaced, restore the backup of the secondary to it.
Permanently swap the roles.
-
I would back up the secondary then restore the backup of the primary on the secondary and eat the downtime.
If I understood him correctly, he made a bunch of changes to the secondary, so he would lose those if he restored from backup.
You could change the interface IPs on the secondary to match the old primary, change the HA settings, then restore a backup of the secondary onto new hardware. -
I would back up the secondary then restore the backup of the primary on the secondary and eat the downtime.
If I understood him correctly, he made a bunch of changes to the secondary, so he would lose those if he restored from backup.
You could change the interface IPs on the secondary to match the old primary, change the HA settings, then restore a backup of the secondary onto new hardware.hmm this seems like a good way :) i think iam going to give this one a try. its a production environment so its a bit delicate…
-
I would not edit the configs.
I would manually set the advbase/advskews of the VIPs from 1/100 to 1/0.
Then make sure any XMLRPC syncs (the standard one and any packages) are set to go from that node to the new secondary. I would just disable them until the secondary is back online. pfsync is bi-directional anyway.
Don't forget the DHCP server partner addresses.
You might also want to change the interface addresses to the ones that were used by the old primary, so the secondary addresses are available when it is brought back online. But HA really doesn't care - that would be to keep the same local convention (I use, for instance, .1 CARP, .2 Primary, .3 Secondary)
I would not do it by editing the configuration.
That all probably would be nearly hitless too. Maybe some address down/up when the VIPs/Addresses are saved so I would set a maintenance window.
-
I obviosly got it wrong and ended up with locking down everything (all ingoing/outgoing traffic freezed) and the secondary lost it's (still very secondary …) settings etc.. so had to revert to a backup of the old secondary - and get that one back online ALONE again.
What i tried with was cloing the machine, then (all network unattached assigning the old primary IP's to LAN, WAN, OTH, etc - renaming it to old primary host name) ..then shutdown - hook up networking - and startup again.
- and I kind of hoped it would be a new primary with all the correct settings etc..
- it was not that simple :)
-
Hi, just wanted to share solution.
changed base/skew on the secondary to 1/0 on all CARP's (so secondary is now primary)
disabled sync
did a fresh install of a new secondary with same ip networs etc. as old primary had.
patch to same version
add all packages that exist on secondary
configure/setup sync in reverse (old secondary is now the primary)
done. -
Perfect. Thanks for reporting back. DHCP servers (if any) are all normal/normal?