Step by step guide for DB2 HADR Â implementation with TSA on AIX/Linux:
HADR with TSA using db2haicu on AIX Linux
Archive for
...
Step by step guide for DB2 HADR Â implementation with TSA on AIX/Linux:
HADR with TSA using db2haicu on AIX Linux
1. How to setup TSA peer domain manually on your system?
2. How to remove TSA peer domain manually from your system?
Creating the TSA peer domain manually
Follow the steps below to create TSA manually your machine:
Example:
Host1: coralaixtest16
Host2: coralaixtest12
From Host1 execute the following commands:
Step 1: preprpnode coralaixtest12 coralaixtest16
Step 2: mkrpdomain db2domain coralaixtest12 coralaixtest16
Step 3: export CT_MANAGEMENT_SCOPE=2
Step 4: startrpdomain db2domain
Output:
-bash-3.2# lsrpdomain
Name OpState RSCTActiveVersion MixedVersions TSPort GSPort
db2domain Online 2.5.3.2 No 12347 12348
-bash-3.2# lsrpnode
Name OpState RSCTVersion
coralaixtest16 Online 2.5.3.2
coralaixtest12 Online 2.5.3.2
Removing the TSA peer domain
1. Check if the peer domain exists on the machine by executing the following command:
-bash-3.2# lsrpdomain
Name OpState RSCTActiveVersion MixedVersions TSPort GSPort
db2domain Online 2.5.3.2 No 12347 12348
If nothing is listed, the host is TSA clean. Only one TSA peer domain can be active (online) at any given time, and any operation (stopping/removing/adding a node) will only affect this online domain.
2. List all the nodes in this active peer domain by running the lsrpnode command. The output of this command should be similar to the following:
Name OpState RSCTVersion
instaixtest5 Offline 2.5.2.2
instaixtest8 Online 2.5.2.2
instaixtest7 Online 2.5.2.2
3. Remove the membership from online peer domain. This step can be accomplished in two ways:
Use this option if you want to remove one or more nodes from your peer domain.
a. Identify one of the online nodes as your target node.
b. Run the stoprpnode <target_node_name> command.
c. Run the rmrpnode <target_node_name> command.
d. Repeat these steps for any other node that you would like to remove from your peer domain.
e. Use this option if you want to remove the entire peer domain, including all nodes.
a. Run the rmrpdomain [PD_name] command.
Example:
rmrpdomain <domainname>
If you want remove the TSA peer domain forcefully, execute the following command:
rmrpdomain –f <domainname>
4. Confirm if the peer domain has been removed or trimmed appropriately.
a. To confirm the peer domain has been removed, run the lsrpdomain command.
b. To confirm the peer domain has been trimmed, run the lsrpnode command.
The TSA peer domain should not be listed in the output.
How can you setup HADR with TSA that would use Virtual IP in IBM DB2 for Linux- UNIX and Windows?
The private and the public networks need to be setup correctly beforehand.
The private network will be used for the communication between primary and standby node for the log replay.
The public network will be used for the applications connecting to the primary and standby (which will become primary after failover) nodes.
A virtual IP address needs to be created which does not need to be attached/mapped to NIC, as this is a virtual IP(VIP). This IP just needs to be provided during the setup through db2haicu.
During the failover, the VIP will be automatically mapped to the public network (eth0 or en0) on the working node and the clients will be automatically re-routed through this IP to use the other node.
The public network IP and hosts need to be defined in /etc/hosts file on both primary and standby servers.
The HADR_LOCAL_HOST and HADR_REMOTE_HOST database configuration parameters need to be assigned with values assigned for the private network.
The port number assigned to SVCENAME dbm cfg parameter needs to be correctly defined in /etc/services file and it should not be used by any other application.
This port will be used for VIP routing.
The VIP is also used for ACR (Automatic Client Re-route).
Here is the link to the white paper which describes in detail how to setup HADR with VIP:
http://download.boulder.ibm.com/ibmdl/pub/software/dw/data/dm-0908hadrdb2haicu/HADR_db2haicu.pdf