Backing up a DPF Db2 cluster configuration to a file

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

About this task

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 DPF 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 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 Majority quorum.
  2. As the root user, back up the cluster configuration. Ensure that the file path specified is not to an existing file:
    ./sqllib/bin/db2cm -export <file path>
  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]# db2cm -list

HA Model: DPF Roving Standby

Domain Information:
Domain name                     = hadomain
Cluster Manager                 = Corosync
  Cluster Manager Version       = 3.1.7
Resource Manager                = Pacemaker
  Resource Manager Version      = 2.1.6-4.db2pcmk.el9
Current domain leader           = dpf-srv-2
Number of nodes                 = 4
Number of resources             = 7

Host Information:
HOSTNAME                        STATE           MAXIMUM PARTITIONS              NUMBER OF PARTITIONS
------------------------        --------        ------------------------        --------------------------
dpf-srv-1                       ONLINE          1                               1
dpf-srv-2                       ONLINE          1                               1
dpf-srv-3                       ONLINE          1                               1
dpf-srv-4                       ONLINE          1                               0

Fencing Information:
Fencing Configured: Configured
Fencing Devices:
----------------
watchdog

Quorum Information:
Quorum Type: Majority
Total Votes: 4
Quorum Votes: 3
Quorum Nodes:
----------------
dpf-srv-1
dpf-srv-2
dpf-srv-3
dpf-srv-4

Resource Information:
Resource Name             = db2_ethmonitor_dpf-srv-1_eth0
  State                         = Online
  Managed                       = True
  Resource Type                 = Network Interface
    Node                        = dpf-srv-1
    Interface Name              = eth0

Resource Name             = db2_ethmonitor_dpf-srv-2_eth0
  State                         = Online
  Managed                       = True
  Resource Type                 = Network Interface
    Node                        = dpf-srv-2
    Interface Name              = eth0

Resource Name             = db2_ethmonitor_dpf-srv-3_eth0
  State                         = Online
  Managed                       = True
  Resource Type                 = Network Interface
    Node                        = dpf-srv-3
    Interface Name              = eth0

Resource Name             = db2_ethmonitor_dpf-srv-4_eth0
  State                         = Online
  Managed                       = True
  Resource Type                 = Network Interface
    Node                        = dpf-srv-4
    Interface Name              = eth0

Resource Name             = db2_partition_db2inst1_0
  State                         = Online
  Managed                       = True
  Resource Type                 = Partition
    Instance                    = db2inst1
    Partition Number            = 0
  Current Host                  = dpf-srv-1

Resource Name             = db2_partition_db2inst1_1
  State                         = Online
  Managed                       = True
  Resource Type                 = Partition
    Instance                    = db2inst1
    Partition Number            = 1
  Current Host                  = dpf-srv-2

Resource Name             = db2_partition_db2inst1_2
  State                         = Online
  Managed                       = True
  Resource Type                 = Partition
    Instance                    = db2inst1
    Partition Number            = 2
  Current Host                  = dpf-srv-3
The following example shows the command syntax and output from backing up a Mutual Failover Db2 cluster to the file backup.conf.:
[root@host1]# db2cm -export /tmp/backup.conf
Cluster configuration has been exported successfully.

[root@host1]# ls -la /tmp/backup.conf
-rw-r--r-- 1 root root 12117 Nov 11 12:16 /tmp/backup.conf