Db2

 View Only

 Activate TSAMP ServiceIP in standby DC

Peter Lambrechtsen's profile image
Peter Lambrechtsen posted Mon April 07, 2025 06:54 AM

I have a DB2 with TSAMP configuration which I do plan to upgrade to Pacemaker at some point but am having an issue I was hoping I could quickly solve.

There are two DCs with two DB2 instances in each DC. Where the local DC standby is NEARSYNC and the remote standbys are SUPERASYNC. 

Primary: Site-1-Server-1 and Site-1-Server-2

Standby: Site-2-Server-1 and Site-2-Server-2

What happens is if we HADR takeover from Site 1 to Site 2 to then TSAMP activates the ServiceIP once DB2 is online. The issue is if we restart the server in Site 1 that previously had the ServiceIP then TSAMP doesn't bring the ServiceIP online on the other Standby Server.

This is how lssam looks.

Pending online IBM.ResourceGroup:db2_isva_isva_HVDB-rg Request=Lock Nominal=Online
        |- Offline IBM.Application:db2_isva_isva_HVDB-rs Control=StartInhibitedBecauseSuspended
                |- Offline IBM.Application:db2_isva_isva_HVDB-rs:s2svr1
                '- Offline IBM.Application:db2_isva_isva_HVDB-rs:s2svr2
        '- Online IBM.ServiceIP:db2ip_100_64_20_110-rs Control=SuspendedPropagated
                |- Online IBM.ServiceIP:db2ip_100_64_20_110-rs:s2svr1
                '- Offline IBM.ServiceIP:db2ip_100_64_20_110-rs:s2svr2
Online IBM.ResourceGroup:db2_isaminst_s2svr1_0-rg Nominal=Online
        '- Online IBM.Application:db2_isaminst_s2svr1_0-rs
                '- Online IBM.Application:db2_isaminst_s2svr1_0-rs:s2svr1
Online IBM.ResourceGroup:db2_isaminst_s2svr2_0-rg Nominal=Online
        '- Online IBM.Application:db2_isaminst_s2svr2_0-rs
                '- Online IBM.Application:db2_isaminst_s2svr2_0-rs:s2svr2
Online IBM.Equivalency:db2_isva_isva_HVDB-rg_group-equ
        |- Online IBM.PeerNode:s2svr1:s2svr1
        '- Online IBM.PeerNode:s2svr2:s2svr2
Online IBM.Equivalency:db2_isaminst_s2svr1_0-rg_group-equ
        '- Online IBM.PeerNode:s2svr1:s2svr1
Online IBM.Equivalency:db2_isaminst_s2svr2_0-rg_group-equ
        '- Online IBM.PeerNode:s2svr2:s2svr2
Online IBM.Equivalency:db2_private_network_0
        |- Online IBM.NetworkInterface:ens34:s2svr1
        '- Online IBM.NetworkInterface:ens34:s2svr2
Online IBM.Equivalency:db2_public_network_0
        |- Online IBM.NetworkInterface:ens33:s2svr1
        '- Online IBM.NetworkInterface:ens33:s2svr2

As above I can see:

                |- Online IBM.ServiceIP:db2ip_100_64_20_110-rs:s2svr1

This is showing that the ServiceIP is online.

If I reboot the host s2svr1 then the ServiceIP doesn't come back.

Failed offline IBM.ResourceGroup:db2_isva_isva_HVDB-rg Nominal=Online
        |- Failed offline IBM.Application:db2_isva_isva_HVDB-rs
                |- Failed offline IBM.Application:db2_isva_isva_HVDB-rs:s2svr1
                '- Failed offline IBM.Application:db2_isva_isva_HVDB-rs:s2svr2
        '- Offline IBM.ServiceIP:db2ip_100_64_20_110-rs
                |- Offline IBM.ServiceIP:db2ip_100_64_20_110-rs:s2svr1
                '- Offline IBM.ServiceIP:db2ip_100_64_20_110-rs:s2svr2
Online IBM.ResourceGroup:db2_isaminst_s2svr1_0-rg Nominal=Online
        '- Online IBM.Application:db2_isaminst_s2svr1_0-rs
                '- Online IBM.Application:db2_isaminst_s2svr1_0-rs:s2svr1
Online IBM.ResourceGroup:db2_isaminst_s2svr2_0-rg Nominal=Online
        '- Online IBM.Application:db2_isaminst_s2svr2_0-rs
                '- Online IBM.Application:db2_isaminst_s2svr2_0-rs:s2svr2
Online IBM.Equivalency:db2_isva_isva_HVDB-rg_group-equ
        |- Online IBM.PeerNode:s2svr1:s2svr1
        '- Online IBM.PeerNode:s2svr2:s2svr2
Online IBM.Equivalency:db2_isaminst_s2svr1_0-rg_group-equ
        '- Online IBM.PeerNode:s2svr1:s2svr1
Online IBM.Equivalency:db2_isaminst_s2svr2_0-rg_group-equ
        '- Online IBM.PeerNode:s2svr2:s2svr2
Online IBM.Equivalency:db2_private_network_0
        |- Online IBM.NetworkInterface:ens34:s2svr1
        '- Online IBM.NetworkInterface:ens34:s2svr2
Online IBM.Equivalency:db2_public_network_0
        |- Online IBM.NetworkInterface:ens33:s2svr1
        '- Online IBM.NetworkInterface:ens33:s2svr2

 The only way to bring it back online is to HADR back to the standby.

The reason for this is we have ACR enabled pointing to the ServiceIP in the other DC. So when we have both ServiceIPs active then any client connecting will automatically know to go to the other DC. But in this situation we don't have the ServiceIP so the client can't connect.

So.. Is there a way to manually bring only the service IP back online so it can be pinged, without needing to bring the DB2 daabase back into the DC?

I think I will need to use something like.

But doing:

chrg -o online db2_isva_isva_HVDB-rg
chrsrc -o online

But the documentation isn't clear what steps I would need to run to bring the ServiceIP online. Any suggestions?

Mark Barinstein's profile image
Mark Barinstein

The suggestion is to keep all-standbys DC cluster in a manual mode.
That is, if you have run TAKEOVER HADR on s2srvX, then run:
on one of s1srvY:
sudo samctrl -M T
on s2srvX:
sudo samctrl -M F

Pros:
You don't want all-standbys DC cluster to run TAKEOVER HADR suddenly, if it decides, that it should do it.
But these TSAMP scripts are not designed to manage auxiliary HADR standbys anyway.

Cons:
You have to start some TSAMP resources manually on any host of all-standbys cluster upon its restart because of the TSAMP cluster manual mode.
DB2 instance start:
sudo startrsrc -s "Name='db2_isaminst_s2svr1_0-rs' & NodeNameList={'s2svr1'}" IBM.Application
If it was the host holding VIP, then:
sudo startrsrc -s "Name='db2ip_100_64_20_110-rs' & NodeNameList={'s2svr1'}" IBM.ServiceIP

THe `stoprsrc` command accepts the same parameters. You specify the host, where the specified resource must be affected.
The cluster expects, that HADR PRIMARY and VIP are on the same host.
If you decide to TAKEOVER HADR back to some host of all-standbys cluster later, you should bring VIP to this host manually beforehand.