Removing a cluster domain
If your Pacemaker resource model is changed or otherwise corrupted on your Db2 HADR Linux cluster, you can remove the cluster domain by using the db2cm utility. This removal can be done regardless of the present state of the cluster.
Before you begin
Important: To run the db2cm utility as the root user, ensure the
DB2INSTANCE environment variable is set to the instance owner.
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.
The removal of the cluster domain involves creating temporary files for logging into the /tmp directory. To accommodate the creation of these files, ensure you have at least 2GB of space in the /tmp directory before proceeding.
About this task
The output shown in the Examples section reflects a cluster in bad shape, with multiple resources in a failed state.
The following placeholders are used in the command statements throughout this procedure. These
represent values that you can change to suit your organization:
- <host1> and <host2> are the host names for the hosts in the Db2 Linux cluster.
- <database_name> is the name of the Db2 database.
- <instance_name> is the name of the Db2 instance on the cluster.
Procedure
Example
The following example shows the command syntax and output for verifying that there are Pacemaker
resources on the Db2 instance (see Step 1.a):
[db2inst1@pcmk-test-srv-1 ~]$ db2cm -status
2024-12-09-08.30.45
-------------------
Cluster Summary:
* Stack: corosync (Pacemaker is running)
* Current DC: pcmk-test-srv-1 (version 2.1.9-1.db2pcmk.el9-3479fba) - partition with quorum
* Last updated: Mon Dec 9 08:30:45 2024 on pcmk-test-srv-1
* Last change: Mon Dec 9 08:22:00 2024 by root via root on pcmk-test-srv-1
* 2 nodes configured
* 6 resource instances configured
Node List:
* Online: [ pcmk-test-srv-1 pcmk-test-srv-2 ]
Full List of Resources:
* db2_ethmonitor_pcmk-test-srv-1_eth1 (ocf:heartbeat:db2ethmon): Started pcmk-test-srv-1
* db2_ethmonitor_pcmk-test-srv-2_eth1 (ocf:heartbeat:db2ethmon): Started pcmk-test-srv-2
* db2_pcmk-test-srv-1_db2inst1_0 (ocf:heartbeat:db2inst): Started pcmk-test-srv-1
* db2_pcmk-test-srv-2_db2inst1_0 (ocf:heartbeat:db2inst): Started pcmk-test-srv-2
* Clone Set: db2_db2inst1_db2inst1_GT-clone [db2_db2inst1_db2inst1_GT] (promotable):
\* Promoted: \[ pcmk-test-srv-2 \] \* Unpromoted: \[ pcmk-test-srv-1 \]
QDevice Information:
* The current user does not have root permission to obtain qdevice informationThe following example shows the command syntax and output from deleting all a cluster and all
cluster resources (see Step 1.b):
root@pcmk-test-srv-1 ~]# /opt/ibm/db2/V12.1/bin/db2cm -delete -domain
Domain deleted successfully.The following example shows the command syntax and output from deactivating the HADR feature from
a database named GT: (see Step 2.a):
[db2inst1@pcmk-test-srv-1 ~]$ db2 deactivate db GT
DB20000I The DEACTIVATE DATABASE command completed successfully.The following example shows the command syntax and output from stopping the HADR feature on a
database named GT: (see Step 2.b):
[db2inst1@pcmk-test-srv-1 ~]$ db2 stop hadr on db GT
DB20000I The STOP HADR ON DATABASE command completed successfully.The following example show the command syntax and ouput from verifying that the HADR feature is
no longer running on the database named GT (see Step 2.c):
[db2inst1@pcmk-test-srv-1 ~]$ db2pd -hadr -db GT
Database GT not activated on database member 0 or this database name cannot be found in the local database directory.
Option -hadr requires -db <database> or -alldbs option and active database.The following example shows the command syntax and output from dropping a database named GT (see
Step 2.d):
[db2inst1@pcmk-test-srv-1 ~]$ db2 drop db GT
DB20000I The DROP DATABASE command completed successfully.The following example shows the command syntax and output from dropping a Db2 instance from a
Linux cluster:
[root@pcmk-test-srv-1 ~]# ./db2idrop db2inst1
DBI1446I The db2idrop command is running.
DB2 installation is being initialized.
Total number of tasks to be performed: 2
Total estimated time for all tasks to be performed: 305 second(s)
Task #1 start
Description: Initializing instance list
Estimated time 5 second(s)
Task #1 end
Task #2 start
Description: Configuring DB2 instances
Estimated time 300 second(s)
Task #2 end
The execution completed successfully.
For more information see the DB2 installation log at
"/tmp/db2idrop.log.3220945".
DBI1070I Program db2idrop completed successfully.The following example shows the command syntax and output from removing the Db2 instance from the
host (see Step 2.h):
[root@pcmk-test-srv-1 install]# ./db2_deinstall -a
DBI1016I Program db2_deinstall is performing uninstallation. Please wait.
The execution completed successfully.
For more information see the DB2 uninstallation log at
"/tmp/db2_deinstall.log.3225496".