Backing-up cluster configuration information

You can save a valid configuration for a Pacemaker-managed cluster to a backup file 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.

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 on a new set of hosts, follow the example in this technote.

Procedure

  1. As the root user, verify that both the hosts, and the cluster resources are online:
    ./sqllib/bin/crm status
    Under Node information, ensure that both nodes are Online. Similarly, make sure that all resources under Resource Information have their states listed as Online. Finally, if Qdevice is configured for quorum, the state under Qdevice-net information should show connected. Otherwise Quorum Information should simply list Two-node quorum.
  2. As the root user, back up the cluster configuration:
    ./sqllib/bin/db2cm -export <file path>

    The file path specified should not be an existing file.

  3. Move the backup configuration file to a location from which it won't 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 if necessary. 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 are online:
./sqllib/bin/crm status
Cluster Status

Domain information:
Domain name               = pcmkdomain
Pacemaker version         = 2.0.2-1.db2pcmk.el8
Corosync version          = 3.0.3
Current domain leader     = jesting1
Number of nodes           = 2
Number of resources       = 6

Node information:
Name name           State
----------------    --------
jesting1            Online
inwards1            Online

Resource Information:

Resource Name             = db2_db2inst1_db2inst1_HADRDB
  Resource Type                 = HADR
    DB Name                     = HADRDB
    Managed                     = true
    HADR Primary Instance       = db2inst1
    HADR Primary Node           = jesting1
    HADR Primary State          = Online
    HADR Standby Instance       = db2inst1
    HADR Standby Node           = inwards1
    HADR Standby State          = Online

Resource Name             = db2_inwards1_db2inst1_0
  State                         = Online
  Managed                       = true
  Resource Type                 = Instance
    Node                        = inwards1
    Instance Name               = db2inst1

Resource Name             = db2_inwards1_eth1
  State                         = Online
  Managed                       = true
  Resource Type                 = Network Interface
    Node                        = inwards1
    Interface Name              = eth1

Resource Name             = db2_jesting1_db2inst1_0
  State                         = Online
  Managed                       = true
  Resource Type                 = Instance
    Node                        = jesting1
    Instance Name               = db2inst1

Resource Name             = db2_jesting1_eth1
  State                         = Online
  Managed                       = true
  Resource Type                 = Network Interface
    Node                        = jesting1
    Interface Name              = eth1

Fencing Information:
  Not Configured
Quorum Information:
  Qdevice

Qdevice information
-------------------
Model:                  Net
Node ID:                1
Configured node list:
    0   Node ID = 1
    1   Node ID = 2
Membership node list:   1, 2

Qdevice-net information
----------------------
Cluster name:           pcmkdomain
QNetd host:             frizzly1:5403
Algorithm:              LMS
Tie-breaker:            Node with lowest node ID
State:                  Connected
The following example shows the command syntax and output from backing up a cluster configuration:
[root@jesting1]$ /home/<instance user>/sqllib/bin/db2cm -export /tmp/backup.conf
Exporting cluster configuration to /tmp/backup.conf...
Export completed successfully.

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