Associate a standby VIP with an existing HADR database of an instance for read-on-standby

You can associated a standby virtual IP address (VIP) to a database resource in a Pacemaker-managed HADR Db2 instance by using the Db2 Cluster Manager (db2cm) utility.

About this task

The following placeholders are used in the command statements throughout this procedure. These represent values that you can change to suit your organization:

  • <host1> is the host name that is to be assigned a VIP within the HADR Db2® instance.
  • <database_name> is the name of the HADR Db2 database that is to be associated with the VIP in the cluster.
  • <instance_name> is the name of the Db2 instance on the cluster.
  • <vip> is the virtual IP address that is being associated with the database on the cluster.

Procedure

  1. As the root user, associate the standby VIP with a database resource in your Db2 instance:
    ./sqllib/bin/db2cm -create -standbyVIP <vip> -instance <instance_name> -db <database_name>
  2. As the root user, verify that the resource is created successfully:
    ./sqllib/bin/crm status

Examples

The following example shows the command syntax and output from associating a standby VIP with the database SAMPLE on the Db2 instance db2inst1:
[root@ignited1 ~]# sqllib/bin/db2cm -create -standbyVIP 9.28.232.70 -instance db2inst1 -db SAMPLE
Standby VIP resource created successfully.
The following example shows the command syntax and output from verifying that the standby VIP is associated with the database in the cluster:
[root@ignited1 ~]# crm status
Stack: corosync
Current DC: ignited1 (version 2.0.2-1.el8-744a30d655) - partition with quorum
Last updated: Tue Mar 10 14:17:23 2020
Last change: Tue Mar 10 14:17:23 2020 by db2inst2 via cibadmin on cuisses1
 
2 nodes configured
7 resources configured
 
Online: [ cuisses1 ignited1 ]
 
Full list of resources:
 
db2_cuisses1_eth0      (ocf::heartbeat:db2ethmon):     Started cuisses1
db2_ignited1_eth0      (ocf::heartbeat:db2ethmon):     Started ignited1
db2_cuisses1_db2inst1_0        (ocf::heartbeat:db2inst):       Started cuisses1
db2_ignited1_db2inst2_0        (ocf::heartbeat:db2inst):       Started ignited1
Clone Set: db2_db2inst1_db2inst2_SAMPLE-clone [db2_db2inst1_db2inst2_SAMPLE] (promotable)
     Masters: [ cuisses1 ]
     Slaves: [ ignited1 ]
db2_db2inst1_db2inst1_SAMPLE-standby-VIP       (ocf::heartbeat:IPaddr2):       Started ignited1