Starting a user-initiated failover on a Mutual Failover Db2 instance
You can initiate a failover and move a mutual failover partition from one host to the other.
Before you begin
You must run the db2cm command from the install path as the root user.
Procedure
Example
$ ./db2cm -list
Cluster Status
Domain information:
Domain name = db2ha
Pacemaker version = 2.1.2-4.db2pcmk.el8
Corosync version = 3.1.6
Current domain leader = haap2
Number of nodes = 2
Number of resources = 4
Node information:
Name State
---------------- --------
haap2 Online
haap1 Online
Resource Information:
Resource Name = db2_haap1_eth0
State = Online
Managed = true
Resource Type = Network Interface
Node = haap1
Interface Name = eth0
Resource Name = db2_haap2_eth0
State = Online
Managed = true
Resource Type = Network Interface
Node = haap2
Interface Name = eth0
Resource Name = db2_db2inst1_0
State = Online
Managed = true
Resource Type = Partition
Instance = db2inst1
Partition = 0
Current Host = haap2
Resource Name = db2_db2inst1_0-mnt_db2hamf
State = Online
Managed = true
Resource Type = File System
Device = "/dev/sdb"
Mount Point = "/db2hamf"
File System Type = ext3
Current Host = haap2
The partition resides on the host haap2:
Resource Name = db2_db2inst1_0
State = Online
Managed = true
Resource Type = Partition
Instance = db2inst1
Partition = 0
Current Host = haap2
The result shows that the partition resides on host haap2The following example
shows the command syntax for moving the partition db2_db2inst1_0 to the host
haap1. See step 2
:
$ /opt/ibm/db2/V11.5/bin/db2cm -move -instance db2inst1 -partition 0 -host haap1
Partition resource db2_db2inst1_0 moved to haap1 successfully.