Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Is there a way to promote a HA Slave to Master (master is gone)

    Scheduled Pinned Locked Moved HA/CARP/VIPs
    10 Posts 3 Posters 1.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P Offline
      planetinse
      last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • P Offline
        planetinse
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • dotdashD Offline
          dotdash
          last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • DerelictD Offline
            Derelict LAYER 8 Netgate
            last edited by

            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.

            Chattanooga, Tennessee, USA
            A comprehensive network diagram is worth 10,000 words and 15 conference calls.
            DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
            Do Not Chat For Help! NO_WAN_EGRESS(TM)

            1 Reply Last reply Reply Quote 0
            • dotdashD Offline
              dotdash
              last edited by

              @Derelict:

              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.

              1 Reply Last reply Reply Quote 0
              • P Offline
                planetinse
                last edited by

                @dotdash:

                @Derelict:

                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…

                1 Reply Last reply Reply Quote 0
                • DerelictD Offline
                  Derelict LAYER 8 Netgate
                  last edited by

                  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.

                  Chattanooga, Tennessee, USA
                  A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                  DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                  Do Not Chat For Help! NO_WAN_EGRESS(TM)

                  1 Reply Last reply Reply Quote 0
                  • P Offline
                    planetinse
                    last edited by

                    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 :)
                    1 Reply Last reply Reply Quote 0
                    • P Offline
                      planetinse
                      last edited by

                      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.

                      1 Reply Last reply Reply Quote 1
                      • DerelictD Offline
                        Derelict LAYER 8 Netgate
                        last edited by

                        Perfect. Thanks for reporting back. DHCP servers (if any) are all normal/normal?

                        Chattanooga, Tennessee, USA
                        A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                        DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                        Do Not Chat For Help! NO_WAN_EGRESS(TM)

                        1 Reply Last reply Reply Quote 1
                        • First post
                          Last post
                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.