Configuring for a Db2 database in HADR
Configure Db2 for generating Dynamic Workload Console reports when Db2 is configured for HADR.
About this task
You can optionally configure Db2 in HADR configuration so that you can connect to the secondary database if the primary database becomes unreachable.
To configure Db2 for generating reports when Db2 is configured for HADR, perform the following steps
Procedure
- Stop WebSphere® Application Server Liberty, as described in Application server - starting and stopping.
-
Browse to the following paths, depending on your operating system:
- On UNIX operating systems
- TWA_home/usr/servers/engineServer/configDropins/templates
- On Windows operating systems
- TWA_home\usr\servers\engineServer\configDropins\templates
-
Copy the datasource.xml file to a working location and
edit it by adding the following strings:
<variable name="db.clientRerouteAlternateServerName" value="secondary_database"/> <variable name="db.clientRerouteAlternatePortNumber" value="secondary_database_port_number"/>
-
You also need to add the call to the above variables. To perform this
operation, modify the string:
as follows:<jndiEntry value="jdbc:db2://${db.serverName}:${db.portNumber}/${db.databaseName}" jndiName="db.url"/>
The resulting string must be as follows::clientRerouteAlternateServerName=${db.clientRerouteAlternateServerName};clientRerouteAlternatePortNumber=${db.clientRerouteAlternatePortNumber};"
<jndiEntry value="jdbc:db2://${db.serverName}:${db.portNumber}/${db.databaseName}:clientRerouteAlternateServerName=${db.clientRerouteAlternateServerName};clientRerouteAlternatePortNumber=${db.clientRerouteAlternatePortNumber};" jndiName="db.url"/>
-
Copy the edited file to the following paths:
- On UNIX operating systems
- TWA_DATA_DIR/usr/servers/engineServer/configDropins/overrides
- On Windows operating systems
- TWA_home\usr\servers\engineServer\configDropins\overrides
- Start WebSphere® Application Server Liberty, as described in Application server - starting and stopping.
Results
You have now configured your Db2database in HADR.
For more information about HADR configuration, see An active-active high availability scenario. For more information about templates, see Configuring HCL Workload Automation using templates.