Backing up a Mutual Failover Db2 cluster configuration to a file

You can back up the details of a Pacemaker-managed Mutual Failover Db2 cluster configuration by using the Db2 Cluster Manager (db2cm) utility.

Before you begin

Important: Mutual Failover high availability is supported when using Pacemaker as the integrated cluster manager. The Pacemaker cluster manager for automated fail-over to HADR standby databases is packaged and installed with Db2® 12.1. Pacemaker can be used for both production and text environments.

About this task

Important: To run the db2cm utility as the root user, ensure the DB2INSTANCE environment variable is set to the instance owner.
The backup file can be used with the -import option to quickly redeploy the cluster onto the same hardware.
Note: The resulting backup configuration cannot be deployed on a new set of hosts where any of the following details are different from the original cluster:
  • Hostnames
  • Domain name
  • Interface names
  • Instance names
  • Database names
  • Primary/Standby virtual IP addresses
  • Qdevice host
To deploy Db2 on a new set of hosts, see Configuring a clustered Mutual Failover environment using the Db2 cluster manager (db2cm) utility.

Procedure

  1. As the root user, verify that both the hosts and the cluster resources are online:
    ./sqllib/bin/db2cm -list
    You should see the following values in the Cluster Status information:
    • The two nodes that are listed under Node information are set as Online.
    • The resources that are listed under Resource information are set as Online.
    • The Qdevice, if configured for quorum, is listed under Qdevice-net as connected.
    • The Qdevice, if not configured for quorum, is listed under Quorum information as Two-node quorum.
  2. As the root user, back up the cluster configuration:
    ./sqllib/bin/db2cm -export <file path>

    Ensure that the file path specified is not to an existing file.

  3. Move the backup configuration file to a location where it cannot be deleted.
    At a later date, the backup file can be used to redeploy the cluster on the same set of hosts using the -import option. For more information, see Restore from a saved Pacemaker cluster configuration.

Example

The following example shows the command syntax and output from verifying that the hosts and cluster resources of the cluster domain testdomain are online:
[root@host1~] # ./sqllib/bin/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
The following example shows the command syntax and output from backing up a Mutual Failover Db2 cluster to the file backup.conf. :
[root@host1]# ./sqllib/bin/db2cm -export /tmp/backup.conf
Exporting cluster configuration to /tmp/backup.conf...
Export completed successfully.

[root@host1]$ ls -la /tmp/backup.conf
-rw-r--r-- 1 root root 12888 Jul 1 14:22 /tmp/backup.conf