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
Procedure
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