IBM Support

Hands-on for failover and takeover in db2ha using active/passive configuration

Technical Blog Post


Abstract

Hands-on for failover and takeover in db2ha using active/passive configuration

Body

This article illustrates how to failover and takeover in db2ha using active/passive configuration. If you want how to set a simple configuration, please refer to the following link.
 
The contents is like as follows.
================================================================
1. environment background
2. failover
3. failback
4. takeover by "rgreq -o move" 
================================================================
 
1. environment background
1-1. topology
node1(haap1): active/passive node
node2(haap2): active/passive node
node3(haap3): shared disk node
- For shared disk implementation, iscsi was used in this document. You can use a shared disk from your SAN server if you have it
 
1-2. oslevel and db2level
RHEL 7.4 / "DB2 v11.1.3.3", "s1804271300", "DYN1804271300AMD64"
 
1-3. lssam output
- haap2 is the active host currently.
Online IBM.ResourceGroup:db2_db2inst1_0-rg Nominal=Online
        |- Online IBM.Application:db2_db2inst1_0-rs
                |- Offline IBM.Application:db2_db2inst1_0-rs:haap1
                '- Online IBM.Application:db2_db2inst1_0-rs:haap2
        '- Online IBM.Application:db2mnt-db2haap-rs
                |- Offline IBM.Application:db2mnt-db2haap-rs:haap1
                '- Online IBM.Application:db2mnt-db2haap-rs:haap2
Online IBM.Equivalency:db2_db2inst1_0-rg_group-equ
        |- Online IBM.PeerNode:haap1:haap1
        '- Online IBM.PeerNode:haap2:haap2
Online IBM.Equivalency:db2_private_network_0
        |- Online IBM.NetworkInterface:eth0:haap1
        '- Online IBM.NetworkInterface:eth0:haap2
 
 
2. failover
- We shutdown the haap2 host and haap1 is changed to active host.
- After some transition, haap1 is changed to Online and haap2 is Failed offline.
- Active transactions in haap2 are rolled back during this failover
Online IBM.ResourceGroup:db2_db2inst1_0-rg Control=MemberInProblemState Nominal=Online
        |- Online IBM.Application:db2_db2inst1_0-rs Control=MemberInProblemState
                |- Online IBM.Application:db2_db2inst1_0-rs:haap1
                '- Failed offline IBM.Application:db2_db2inst1_0-rs:haap2 Node=Offline
        '- Online IBM.Application:db2mnt-db2haap-rs Control=MemberInProblemState
                |- Online IBM.Application:db2mnt-db2haap-rs:haap1
                '- Failed offline IBM.Application:db2mnt-db2haap-rs:haap2 Node=Offline
Online IBM.Equivalency:db2_db2inst1_0-rg_group-equ
        |- Online IBM.PeerNode:haap1:haap1
        '- Offline IBM.PeerNode:haap2:haap2 Node=Offline
Online IBM.Equivalency:db2_private_network_0
        |- Online IBM.NetworkInterface:eth0:haap1
        '- Offline IBM.NetworkInterface:eth0:haap2 Node=Offline
 
 
3. failback
- We turn on the haap2 host and see the lssam output.
- The haap2 host is changed to Offline status.
Online IBM.ResourceGroup:db2_db2inst1_0-rg Nominal=Online
        |- Online IBM.Application:db2_db2inst1_0-rs
                |- Online IBM.Application:db2_db2inst1_0-rs:haap1
                '- Offline IBM.Application:db2_db2inst1_0-rs:haap2
        '- Online IBM.Application:db2mnt-db2haap-rs
                |- Online IBM.Application:db2mnt-db2haap-rs:haap1
                '- Offline IBM.Application:db2mnt-db2haap-rs:haap2
Online IBM.Equivalency:db2_db2inst1_0-rg_group-equ
        |- Online IBM.PeerNode:haap1:haap1
        '- Online IBM.PeerNode:haap2:haap2
Online IBM.Equivalency:db2_private_network_0
        |- Online IBM.NetworkInterface:eth0:haap1
        '- Online IBM.NetworkInterface:eth0:haap2
 
 
4. takeover by "rgreq -o move"
- We need to use "rgreq -o move" as a root to takeover active role in this configuration.
- Since haap2 is passive host at the moment, we issue this command from haap2 to takeover the active role back to haap2.
[root@haap2 ~]# rgreq -o move db2_db2inst1_0-rg
Completed applying request to resource group "db2_db2inst1_0-rg".
 
- After some transition, haap2 is changed back to active host.
Online IBM.ResourceGroup:db2_db2inst1_0-rg Nominal=Online
        |- Online IBM.Application:db2_db2inst1_0-rs
                |- Offline IBM.Application:db2_db2inst1_0-rs:haap1
                '- Online IBM.Application:db2_db2inst1_0-rs:haap2
        '- Online IBM.Application:db2mnt-db2haap-rs
                |- Offline IBM.Application:db2mnt-db2haap-rs:haap1
                '- Online IBM.Application:db2mnt-db2haap-rs:haap2
Online IBM.Equivalency:db2_db2inst1_0-rg_group-equ
        |- Online IBM.PeerNode:haap1:haap1
        '- Online IBM.PeerNode:haap2:haap2
Online IBM.Equivalency:db2_private_network_0
        |- Online IBM.NetworkInterface:eth0:haap1
        '- Online IBM.NetworkInterface:eth0:haap2

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

UID

ibm13285711