WORKLOAD AUTOMATION COMMUNITY
  • Home
  • Blogs
  • Forum
  • Resources
  • Events
  • About
  • Contact
  • What's new

Workload Automation 10.2.2 How to Set Up Master Domain Manager with DB2 HADR

5/15/2024

0 Comments

 
Picture
If you want to avoid a potential business disruption in your Workload Automation environment, you should leverage the Master Domain Manager configuration. But, what happens if the RDBMS connected to Workload Automation crashes? 
In this article, we will describe how to manage the Master Domain Manager and DB2 HADR to allow business continuity during a disaster event.
​
Scenario
To avoid possible disasters in a Master Domain Manager production environment, you must configure your environment in high availability.
Picture
In the above figure we can see the following components on three different platforms:
  • DB2 HADR NODE 1 = 10.10.23.01 | AS-AHC-LNX001. DB NAME “SIM” PORT 50001 | INSTANCE “db2inst1”
  • DB2 HADR NODE 2 = 10.10.23.02 | AS-AHC-LNX002. DB NAME “SIM” PORT 25010 | INSTANCE “db2inst1”
  • MDM 10.2.2 = 10.10.23.03 | AS-AHC-LNX003
 
How to set up DB2 HADR for Workload Automation
This configuration is composed of two nodes (NODE 1 and NODE 2) on which are installed Master Domain Manager (MDM)
The DB2 HADR is composed of two nodes, one is the primary node (NODE 1) that is active and a secondary node (NODE 2) that is in standby mode synchronizing data with the primary node. 
 
DB2 HADR configuration
To configure the Workload Automation database in HADR we’ve to setup DB2 as below on both nodes.
In the following commands, "SIM" is the database name.
 
Setup NODE 1 - NODE 2 database properties:
 
This parameter specifies the hostname of the local database
db2 update db cfg for SIM using HADR_LOCAL_HOST <NODE1|NODE2>
NODE 1: db2 update db cfg for SIM using HADR_LOCAL_HOST 10.10.23.01
NODE 2: db2 update db cfg for SIM using HADR_LOCAL_HOST 10.10.23.02
 
This parameter specifies the hostname of the remote database
db2 update db cfg for SIM using HADR_REMOTE_HOST <NODE1|NODE2>
NODE 1: db2 update db cfg for SIM using HADR_REMOTE_HOST 10.10.23.02
NODE 2: db2 update db cfg for SIM using HADR_REMOTE_HOST 10.10.23.01
 
This parameter specifies the local DB2 service name
db2 update db cfg for SIM using HADR_LOCAL_SVC <local service name>
NODE 1: db2 update db cfg for SIM using HADR_LOCAL_SVC 60070
NODE 2: db2 update db cfg for SIM using HADR_LOCAL_SVC 60070
 
 
This parameter specifies the remote DB2 service name
db2 update db cfg for SIM using HADR_REMOTE_SVC <remote service name>
NODE 1: db2 update db cfg for SIM using HADR_REMOTE_SVC 60070
NODE 2: db2 update db cfg for SIM using HADR_REMOTE_SVC 60070
 
This parameter specifies the remote instance name
db2 update db cfg for SIM using HADR_REMOTE_INST <remote instance name>
NODE 1: db2 update db cfg for SIM using HADR_REMOTE_INST db2inst1
NODE 2: db2 update db cfg for SIM using HADR_REMOTE_INST db2inst1
 
This parameter set the logindexbuild database configuration parameter to ON to ensure that complete information is logged for index creation, re-creation, and reorganization
db2 update db cfg for SIM using LOGINDEXBUILD <ON>
NODE 1: db2 update db cfg for SIM using LOGINDEXBUILD ON
NODE 2: db2 update db cfg for SIM using LOGINDEXBUILD ON
 
This parameter specifies the transaction logs synch mode. This parameter should set depending on various factors like network speed between nodes
db2 update db cfg for SIM using HADR_SYNCMODE <sync mode>
NODE 1: db2 update db cfg for SIM using HADR_SYNCMODE NEARSYNC
NODE 2: db2 update db cfg for SIM using HADR_SYNCMODE NEARSYNC
 
This parameter specifies the media type of the primary destination for logs that are archived from the current log path
db2 UPDATE DB CFG for SIM USING logarchmeth1 <LOGRETAIN>
NODE 1: db2 UPDATE DB CFG for SIM USING logarchmeth1 LOGRETAIN
NODE 2: db2 UPDATE DB CFG for SIM USING logarchmeth1 LOGRETAIN
 
This parameter specifies the DB alternate server name and port
db2 update alternate server for database SIM using hostname <other machine> port <db_port>
NODE 1: db2 update alternate server for database SIM using hostname AS-AHC-LNX002 port 25010
NODE 2: db2 update alternate server for database SIM using hostname AS-AHC-LNX001 port 50001
 
Backup of NODE 1 and restore to NODE 2
Make a backup of NODE 1 and restore to NODE 2 to import the MDM definition and tables
On NODE 1 issue the following command:
db2 BACKUP DATABASE SIM ON ALL DBPARTITIONNUMS TO <folder>
This command creates a file like: SIM.0.db2inst1.DBPART000.20240417052131.001
Copy this file to a folder on NODE 2
On NODE 2 issue the following command:
db2 RESTORE DATABASE SIM FROM <folder>
 
Start HADR on both nodes
Now that HADR is configured, we have to start it using a fixed order: first the standby node and then the primary one.
On NODE 2 issue the following command:
db2 start hadr on db SIM as standby
On NODE 1 issue the following command:
db2 start hadr on db SIM as primary
 
How to configure WebSphere Liberty to manage DB2 HADR
After configured DB2 in HADR, we have to configure the MDM datasource of Liberty in order to point to HADR instead of single DB node.
So, Liberty, also if doesn’t know where DB is physically active, is able to reach MDM database. 
To configure MDM datasource properties edit the file <TWA_HOME>/<DATADIR>/usr/servers/engineServer/configDropins/overrides/datasource.xml:
Add the highlighted parameters to the properties section:
<properties.db2.jcc
serverName="NODE1"
portNumber="50001"
databaseName="SIM"
user="db2inst1"
password="="{xor}xxxxxxxxxxxxxxxxxx”
clientRerouteAlternateServerName="NODE2"
clientRerouteAlternatePortNumber="25010"
retryIntervalForClientReroute="2"
maxRetriesForClientReroute="3"
 
 Now let's try the steps:
  • Create “SIM” dbname on NODE 1: db2 create db SIM
  • Install MDM 10.2.2 using the dbname SIM
  • When the installation finishes, immediately shut down all MDM processes
  • Run the following commands on NODE 1 and finally run db2stop and then db2start
db2 update db cfg for SIM using HADR_LOCAL_HOST 10.10.23.01
db2 update db cfg for SIM using HADR_LOCAL_SVC 60070
db2 update db cfg for SIM using HADR_REMOTE_HOST 10.10.23.02
db2 update db cfg for SIM using HADR_REMOTE_SVC 60070
db2 update db cfg for SIM using HADR_REMOTE_INST db2inst1
db2 update db cfg for SIM using LOGINDEXBUILD ON
db2 UPDATE DB CFG FOR SIM USING HADR_SYNCMODE NEARSYNC
db2 UPDATE DB CFG for SIM USING logarchmeth1 LOGRETAIN
db2 update alternate server for database SIM using hostname AS-AHC-LNX002 port 25010

  • Backup NODE 1 with the command “db2 BACKUP DATABASE SIM ON ALL DBPARTITIONNUMS TO /tws_images/db2backup” (creates a backup file like SIM.0.db2inst1.DBPART000.20240417052131.001)
Picture
  • Copy the backup file to a folder on NODE 2 and restore with the command “db2 RESTORE DATABASE SIM FROM /tws_images/db2backup”
Picture
  • Run the following commands on NODE 2 and finally run db2stop and then db2start
db2 update db cfg for SIM using HADR_LOCAL_HOST 10.10.23.02
db2 update db cfg for SIM using HADR_LOCAL_SVC 60070
db2 update db cfg for SIM using HADR_REMOTE_HOST 10.10.23.01
db2 update db cfg for SIM using HADR_REMOTE_SVC 60070
db2 update db cfg for SIM using HADR_REMOTE_INST db2inst1
db2 update db cfg for SIM using LOGINDEXBUILD ON
db2 UPDATE DB CFG FOR SIM USING HADR_SYNCMODE NEARSYNC
db2 UPDATE DB CFG for SIM USING logarchmeth1 LOGRETAIN
db2 update alternate server for database SIM using hostname AS-AHC-LNX001 port 50001
  
  • On NODE 2 issue the following command:
db2 start hadr on db SIM as standby
Picture
​
  • On NODE 1 issue the following command:
db2 start hadr on db SIM as primary
Picture
​
  • Check the status of NODE 1 and NODE 2 with following command:
db2pd -db SIM -hadr
 
Troubleshooting: How to check HADR health
To check the HADR status issue the following command on both nodes:
db2pd –hadr –db SIM
where SIM is the database name.
Here an example of output of the command on the NODE 1:
Picture
This picture shows the status of HADR on primary node
Highlighted parameters are the ones that describes the HADR healthy:
HADR_ROLE: on primary node (NODE 1) must be PRIMARY and STANDBY on secondary node (NODE 2)
HADR_STATE: must be PEER
HADR_CONNECT_STATUS: must be CONNECTED
LOG_TIME parameters describes the latest transaction log on all nodes: the date and time must be synchronized and up-to-date
 
 Below an example of output of the command on the NODE 2:
Picture
​
  • Edit datasource.xml on MDM and add hostname and port of NODE 2: <TWA_HOME>/<DATADIR>/usr/servers/engineServer/configDropins/overrides/datasource.xml
 
<variable name="db.clientRerouteAlternateServerName" value="AS-AHC-LNX002"/>
<variable name="db.clientRerouteAlternatePortNumber" value="25010"/>
 retryIntervalForClientReroute="2"
 maxRetriesForClientReroute="3"

  • Now we can Start Up MDM and run JnextPlan
  
How to recover from disaster
To recover from a disaster scenario, for example if the primary node (NODE 1) crashes, we can leverage multi node environment to allow business continuity.
 
Takeover database on standby node
We’ve to “takeover” the database on the secondary node.
  • On NODE 2 issue the following command:
db2pd -db SIM -hadr
Picture
​Now the NODE 2 is a “PRIMARY” NODE:
Picture
​NODE 1 is “STANDBY” NODE:
Picture
  • Turn off NODE 1 to simulate a disaster scenario
Picture
Picture
​Now the MDM is using NODE 2. I'm trying an “optman ls” and submitting one simple job
Picture
Picture
Author

​Simone Grammatico
Simone is an IT Specialist and QA Tester at HCL Software with 20 years of experience as a consultant to public administration clients and later, since 2012, as a QA business software tester. Today, he is in charge of customer support (L3), FixPacks release, and Security Test of Workload Automation.
0 Comments

Your comment will be posted after it is approved.


Leave a Reply.

    Archives

    March 2025
    February 2025
    January 2025
    December 2024
    November 2024
    October 2024
    September 2024
    August 2024
    July 2024
    June 2024
    May 2024
    April 2024
    March 2024
    February 2024
    January 2024
    October 2023
    August 2023
    July 2023
    June 2023
    May 2023
    April 2023
    March 2023
    February 2023
    January 2023
    December 2022
    September 2022
    August 2022
    July 2022
    June 2022
    May 2022
    April 2022
    March 2022
    February 2022
    January 2022
    December 2021
    October 2021
    September 2021
    August 2021
    July 2021
    June 2021
    May 2021
    April 2021
    March 2021
    February 2021
    January 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    July 2020
    June 2020
    May 2020
    April 2020
    March 2020
    January 2020
    December 2019
    November 2019
    October 2019
    August 2019
    July 2019
    June 2019
    May 2019
    April 2019
    March 2019
    February 2019
    January 2019
    December 2018
    November 2018
    October 2018
    September 2018
    August 2018
    July 2018
    June 2018
    May 2018
    April 2018
    March 2018
    February 2018
    January 2018
    December 2017
    November 2017
    October 2017
    September 2017
    August 2017
    July 2017
    June 2017
    May 2017

    Categories

    All
    Analytics
    Azure
    Business Applications
    Cloud
    Data Storage
    DevOps
    Monitoring & Reporting

    RSS Feed

www.hcltechsw.com
About HCL Software 
HCL Software is a division of HCL Technologies (HCL) that operates its primary software business. It develops, markets, sells, and supports over 20 product families in the areas of DevSecOps, Automation, Digital Solutions, Data Management, Marketing and Commerce, and Mainframes. HCL Software has offices and labs around the world to serve thousands of customers. Its mission is to drive ultimate customer success with their IT investments through relentless innovation of its products. For more information, To know more  please visit www.hcltechsw.com.  Copyright © 2024 HCL Technologies Limited
  • Home
  • Blogs
  • Forum
  • Resources
  • Events
  • About
  • Contact
  • What's new