Associating a database mount resource with an existing Mutual Failover partition

You can associate a mounted database resource with a partition in a Pacemaker-managed Mutual Failover Db2 instance by using the Db2 Cluster Manager (db2cm) utility.

Before you begin

Important: In Db2® 11.5.8 and later, Mutual Failover high availability is supported when using Pacemaker as the integrated cluster manager. In Db2 11.5.6 and later, the Pacemaker cluster manager for automated fail-over to HADR standby databases is packaged and installed with Db2. In Db2 11.5.5, Pacemaker is included and available for production environments. In Db2 11.5.4, Pacemaker is included as a technology preview only, for development, test, and proof-of-concept environments.
The following prerequisites must be met before proceeding with the procedure:
  • The target database must exist
  • The target database must be in a location from which a connection can be made.
  • The mount target must be eligible for mount creation. For more information, see the prerequisites section of Associating a mounted remote file system with a Mutual Failover Db2 partition.
  • Mount points cannot be nested (one mount requires another mount to be available first).

About this task

You can associate the following database mount resources with a Pacemaker-managed Mutual Failover Db2 database:

  • Local database directory
  • log path
  • Mirror log path
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 for the Mutual Failover host where the partition resides in the Db2 Linux cluster.
  • <partition_number> is a unique number that identifies the database partition server in the Db2 Pacemaker cluster. For more information, see dbpartitionnum.
  • <database_name> is the name of the mounted database resource to be associated with the partition on the Db2 instance.
  • <instance_name> is the name of the Db2 instance on the cluster.

Procedure

  1. As the root user, add a mount point for the database resource to the partition on your Db2 instance:
    ./sqllib/bin/db2cm –add -dbMount <database_name> -partition <partition_number> -instance <instance_name>
  2. As the root user, verify that the mounted database resource has been associated with the cluster domain of your Mutual Failover Db2 instance:
    ./sqllib/bin/db2cm -list  

Examples

The following example shows the command syntax and output from associating a mounted database resource with a partition on a Pacemaker-managed Mutual Failover Db2 instance (see step 1):
[root@host1~] # db2cm –add -dbMount testdb -partition 0 -instance db2inst
Mount resource for /testmnt2 on instance db2inst partition 0 created successfully.
The following example shows the command syntax and output from verifying that a mounted database resource has been added to a partition on the Pacemaker-managed Mutual Failover Db2 instance db2inst1 (see step 2):
[root@host1~] # db2cm -list  
      			Cluster Status
 
Domain information:
Domain name             = testdomain
Pacemaker version       = 2.1.2-4.db2pcmk.el8
Corosync version        = 3.1.6-2.db2pcmk.el8
Current domain leader   = testdomain-srv-2
Number of nodes         = 2
Number of resources     = 5
 
Node information:
Name name           State
----------------    --------
testdomain-srv-1     Online
testdomain-srv-2     Online

Resource Information:
 
Resource Name             = db2_testdomain-srv-1_eth0
  State                   = Online
  Managed                 = true
  Resource Type           = Network Interface
    Node                  = testdomain-srv-1
    Interface Name        = eth0
 
Resource Name             = db2_testdomain-srv-2_eth0
  State                   = Online
  Managed                 = true
  Resource Type           = Network Interface
    Node                  = testdomain-srv-2  
    Interface Name        = eth0
 
Resource Name             = db2_db2inst_0
  State                   = Online
  Managed                 = true
  Resource Type           = Partition
  Instance                = db2inst
  Partition               = 0
  Current Host            = testdomain-srv-1
 
Resource Name             = db2_regress1_0-instmnt_testmnt
  State                   = Online
  Managed                 = true
  Resource Type           = File System
  Device                  = "/dev/sdb"
  Mount Point             = "/testmnt"
  File System Type        = ext3
  Mount Options           = "rw,relatime"
  Current Host            = testdomain-srv-1

Resource Name             = db2_regress1_0-mnt_testmnt2
  State                   = Online
  Managed                 = true
  Resource Type           = File System
  Device                  = "/dev/sda"
  Mount Point             = "/testmnt2"
  File System Type        = ext3
  Mount Options           = "acl,user_xattr,noauto"
  Current Host            = mondstadt-srv-1
The mounted database resource db2_db2inst_0-mnt_testmnt2 is listed in the cluster domain .