Monday, April 04, 2011

DB2 9.7 HADR with TSA - Part 07 : Configuring DB2 9.7 HADR to work with TSA

In this artical i will discuss some of the pre-req needed to configure DB2 HADR with TSA and provide some useful references.
a) Pre-Configuration Details
b) Configuring DB2 HADR with TSA
c) Monitoring DB2 HADR with TSA configuration

Part 0 : DB2 9.7 HADR with TSA Part 00 - Introduction






A) Pre-Configuration Details

Item # DescriptionCommand
System On which command will be executed => PrimaryStandby
1 Archive the Current db2diag.log file
db2diag -A

db2diag -A
2 Set the database HADR_PEER_WINDOW configuration parameter to non-zero value
db2 get db cfg for sample | grep -i hadr

db2 get db cfg for sample | grep -i hadr 
3 Prepare the Environment for TSA configuration
a) Login as root
su -

b) Execute the TSA command
preprpnode {node1} {node2}

For Example,
preprpnode mumbai london

a) Login as root
su -

b) Execute the TSA command
preprpnode {node1} {node2}

For Example,
preprpnode mumbai london
4 Identify your Virutal IP(VIP)m DB2 Service Port and Network Quorum IP Address
a) Virtual IP => 192.168.5.55

b) DB2 Service Port
DBM CFG parameter svcename = 60000

c) Network Quorum IP address
In production Environment this should be the address of third machine which becomes the tie breaker. For testing purpose i am using one of the DB2 HADR node IP address.





B) Configuring DB2 HADR with TSA

Item # DescriptionCommand
System On which command will be executed => PrimaryStandby
1 Login as Instance owner No Operation
su - db2inst1
2 Configure the DB2 HADR with TSA No Operation
a) Start the DB2 HA instance configuration Utility
db2haicu

b) Refere the below link for further step by step details
ftp://ftp.software.ibm.com/software/data/pubs/papers/HADR_db2haicu.pdf
3 Problem resoultion for the errors when using Virutal Machine
"If during the creation of Cluster domain following error is reported. This happen when the HADR node is cloned using OS copy command.

Error
2632-044 The domain cannot be created due to the following errors that were detected while harvesting information from the target nodes:
london: 2632-068 This node has the same internal identifier as mumbai and cannot be included

Action

1) Identify the node where it is failing in the db2diag.log file with the above message. For example, from the above message we see "london" is the node name"

2) Login as ""root"" user on that node

3) Execute the command
/usr/sbin/rsct/install/bin/recfgct

4) Prepare the nodes again on both PRIMARY and SECONDARY
preprpnode mumbai london 
 
 
If you get following errors on Standby
2011-10-06-17.53.36.820837-240 E11710207E627       LEVEL: Warning
PID     : 15534                TID  : 47621153264496PROC : db2haicu
INSTANCE: db2inst1             NODE : 000
FUNCTION: DB2 Common, SQLHA APIs for DB2 HA Infrastructure, sqlhaUICreateHADR, probe:1000
RETCODE : ECF=0x9000056F=-1879046801=ECF_SQLHA_HADR_VALIDATION_FAILED
          The HADR DB failed validation before being added to the cluster
MESSAGE : Standby Node not configured for HADR.
DATA #1 : String, 8 bytes
db2inst1
DATA #2 : String, 8 bytes
db2inst1
DATA #3 : String, 6 bytes
sydney
DATA #4 : String, 6 bytes
london
DATA #5 : String, 6 bytes
SAMPLE


1) Refer link
https://www-304.ibm.com/support/docview.wss?uid=swg21420060
https://www-304.ibm.com/support/docview.wss?uid=swg21443643
http://www.ibm.com/developerworks/data/tutorials/dm-1009db2hadr/section3.html



C) Monitoring DB2 HADR with TSA configuration

Item # DescriptionCommand
System On which command will be executed => PrimaryStandby
1 Listing the TSA resources and resource groups as "Instance Owner" user
a) Point in time Snapshot
lssam 

b) Continues Snapshot
 lssam -top
2 Check Network Equivalency
lsequ -Ab
3 Identify the Communication Group
lsrsrc -Ab IBM.NetworkInterface Name IPAddress CommGroup HeartbeatActive NodeNameList
4 Active TieBreaker
lsrsrc -c IBM.PeerNode OpQuorumTieBreaker
5 Service IP Resource
lsrsrc -Ab IBM.ServiceIP
6 Active TieBreaker
lsrsrc -c IBM.PeerNode OpQuorumTieBreaker

D) Some useful resolution

A) Error "2612-023" when attempting "resetrsrc" on "Failed Offline" standby resource





Action
1) Identify the Node on which the resource is shown "Failed Offline".

2) Login to node on which it is failing as "root" user

3) Execute "export CT_MANAGEMENT_SCOPE=2"

4) Execute the following command
resetrsrc -s "Name='db2_db2inst1_db2inst1_SAMPLE-rs' and NodeNameList={'sydney'}" IBM.Application

5) The above command will take the resource out of "Failed Offline" mode.

B) Sometime the "Resource Group" state is shown "Offline" even after all the resource under the resource group are Online.
Action
1) Change the Nominal state of all the "Resource Group" to "Offline"
chrg -o offline

2) Stop the HADR configuration on the database using below sequence
Primary  =>  db2 stop hadr on database sample
Primary  => db2 deactivate db sample
Primary  => db2stop force
Standby  =>  db2 deactivate db sample
Standby  => db2 stop hadr on db sample
Standby  => db2stop force

3) Login as "root" user on any one of the node in the cluster and stop the cluster domain
lsrpdomain
stoprpdomain

4) Start the cluster domain as "root" user on any one node.
startrpdomain
lsrpdomain
lsrpnode

Notes:   The domain take some time to bring all the services online so please be patience

5) Change the Nominal state of instance "Resource Group" to "Online" using below sequence
chrg -o online
chrg -o online

Notes:  After execution of the above command instance on both the server are started automatically

6) Start the HADR on the database using below sequence
Primary  =>  db2 activate db sample
Standby  => db2 start hadr on db sample as standby
Primary  => db2 start hadr on db sample as primary
db2pd -db sample -hadr    ........... This show state as "Peer"

7) Change the Nominal state of "HADR Resource group" to "Online" using below sequence
chrg -o online

8) Check to see if all the resources are showing state as "Online"
lssam







1 comment:

Unknown said...

Tableau data visualization Software
SQIAR (http://www.sqiar.com/solutions/technology/tableau) is a leading Business Intelligence company and provides Tableau Software consultancy across United Kingdom and USA