Informix

 View Only
Expand all | Collapse all

Manual PRI and RSS switch-over

  • 1.  Manual PRI and RSS switch-over

    Posted Fri November 10, 2023 04:42 AM

    Hi,

    We have two servers setup, PRI and RSS.
    How to switch their roles? I suspect the Admin Guide omits some significant steps.



    ------------------------------
    Sincerely,
    Dennis
    ------------------------------


  • 2.  RE: Manual PRI and RSS switch-over

    IBM Champion
    Posted Fri November 10, 2023 06:24 AM

    Dennis:

    The first step is to promote the RSS to HDR because an RSS cannot directly become a primary. Once that's done, there are two scripts in $INFORMIXDIR/bin that are used to swap roles. Once the original primary has been made the HDR secondary you can change it do RSS. The two scripts are:

    /opt/informix/infmx/bin/hdrmkpri.sh  -- This is run on the HDR secondary to make it the new primary

    /opt/informix/infmx/bin/hdrmksec.sh -- This is run on the original primary to make it the new HDR secondary

    Running them tells you what to do:

    $ /opt/informix/infmx/bin/hdrmkpri.sh

     This script changes the type of the Data replication server to Primary.

    Steps to switch server types in an HDR pair:

     Instance A (currently Primary)          Instance B (currently Secondary)
     ------------------------------          --------------------------------
     1] onmode -ky                              (server should be up)
                                             2] hdrmkpri.sh <primary_server_name>
     3] hdrmksec.sh <secondary_server_name>
        (now a Secondary server)             4] oninit (now a Primary server)

    WARNING: Please ensure the following before proceeding further:

              1] the paired  database server is OFFLINE,
              2] the current database server is up, and
              3] the current database server has Data replication turned off.

            Not doing so, shall make the two database servers in the
            Data replication pair out-of-sync, and shall require
            re-establishing the pair.

    Press return to continue...

    The note about "Data replication" is referring to ER.



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 3.  RE: Manual PRI and RSS switch-over

    Posted Fri November 10, 2023 09:48 AM
    Edited by Dennis Melnikov Fri November 10, 2023 09:48 AM

    Art:
    Please, is it a correct sequence for the first step, to promote the RSS to HDR secondary?

    PRI> onmode -u
    RSS> onmode -ky
    RSS> oninit -PHY
    PRI> onmode -d primary RSS
    RSS> onmode -d secondary PRI



    ------------------------------
    Sincerely,
    Dennis
    ------------------------------



  • 4.  RE: Manual PRI and RSS switch-over

    IBM Champion
    Posted Fri November 10, 2023 10:42 AM

    Much easier...as long as you don't already have an HDR (i.e. it is ONLY a Primary and RSS).

    Just run that last command on the RSS.  Both instances can remain online.

    (on the RSS instance) onmode -d secondary <primary_name>

    That should be it.

    As a quick note, I have sometimes found it necessary to delete the RSS from the Primary to avoid issues later on, with (on the Primary) onmode -d delete RSS <rss_name>



    ------------------------------
    Mike Walker
    xDB Systems, Inc
    www.xdbsystems.com
    ------------------------------



  • 5.  RE: Manual PRI and RSS switch-over

    IBM Champion
    Posted Fri November 10, 2023 11:13 AM

    Dennis:

    OK, so, in reality an RSS secondary does nit need a primary but can work with a standalone as its "primary". So you could convert the RSS to a standalone to master the other server. The problem is that the current primary is either in primary mode or standalone mode and my not sync to the former RSS

     You can try it does not always work which is why i recommended converting to HDR first.If it fails you will have to restore or ifxclone from the former RSS to recreate the new RSS. Here are the steps:

    • on the primary:  onmode -ky
    • on the RSS: onmode - d standalone
    • on the original primary: oninit -PHY
    • then: onmode -d RSS other's_name
    • on the former RSS: onmode -d add RSS old_prime_name

    Art



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 6.  RE: Manual PRI and RSS switch-over

    Posted Mon November 20, 2023 09:40 AM

    Art,

    What is a less risky way to convert an HDR secondary to a RSS?



    ------------------------------
    Sincerely,
    Dennis
    ------------------------------



  • 7.  RE: Manual PRI and RSS switch-over

    IBM Champion
    Posted Mon November 20, 2023 09:46 AM

    Dennis:

    I'm confused. I thought you were trying to swap roles between your primary and an RSS secondary?

    As for how to convert an HDR secondary to an RSS secondary, you just have to run:

    On the primary:

    onmode -d add RSS <secondary>

    On the HDR secondary:

    onmode -d RSS <primary>

    If you will not need any HDR secondaries running, you can convert the primary to a standalone server (RSS does not need its "primary" to be in "primary mode":

    on the primary:

    onmode -d standard 

    Art



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 8.  RE: Manual PRI and RSS switch-over

    IBM Champion
    Posted Mon November 20, 2023 09:49 AM

    Oh, just note, while an HDR does not need this, RSS secondaries must have LOG_INDEX_BUILDS set, so you may have to set that before changing the secondary's mode:

    onmode -wf LOG_INDEX_BUILDS=1



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 9.  RE: Manual PRI and RSS switch-over

    IBM Champion
    Posted Mon November 20, 2023 11:55 AM

    Hi Art,

    that 'onmode -d add RSS <rss_name>' on primary isn't even needed - it would occur implicitly when running 'onmode -d RSS <pri_name>' on the HDR secondary.

    It would even be safer to do it this way; I think I remember ambiguous behavior and hangs  when first adding the same server as an RSS that already is connected as HDR secondary.

    Cheers,

     Andreas



    ------------------------------
    Andreas Legner
    ------------------------------



  • 10.  RE: Manual PRI and RSS switch-over

    Posted Tue November 21, 2023 10:04 AM
    Edited by Dennis Melnikov Wed November 22, 2023 03:53 AM

    Finally, that's a sequence I used in my QA landscape:

    Start: idspri (Primary), idssec (RSS)
    Finish: idspri (RSS), idspri (Primary)

    1. Turn RSS into HDR secondary

    `idssec> onmode -d secondary idspri`

    1. Swap HDR roles

    `idspri> onmode -ky`

    `idssec> hdrmkpri.sh`

    `idspri> hdrmksec.sh idssec`

    `idssec> oninit`

    1. Turn new HDR secondary into RSS

    `idspri> onmode -d RSS idssec`

    It's likely the shortest path possible.



    ------------------------------
    Sincerely,
    Dennis
    ------------------------------