Enabling HADR Automatic Client Reroute on Db2 Warehouse
You can enable the Db2 Warehouse HADR Automatic Client Reroute (ACR) feature by running the manage_hadr command with the -enable_acr option.
You must run this command on both the primary and standby deployments. If all client connections
are coming from within the same Red Hat OpenShift cluster, use the engn-svc service
name and port of the other deployment. If client connections are external, use the hostname or IP
address of the IBM Software
Hub instance, and the
NodePort of the engn-svc service of the other deployment.
Internal clients
On clients within your Red Hat OpenShift cluster, run the following commands to enable HADR automatic client reroute:
oc exec -it primary-db2wh-svc-id-db2u-0 -- manage_hadr -enable_acr standby-db2wh-svc-id-db2u-engn-svc:port
oc exec -it standby-db2wh-svc-id-db2u-0 -- manage_hadr -enable_acr primary-db2wh-svc-id-db2u-engn-svc:port
Where db2wh-svc-id is the Db2 Warehouse service identifier on IBM Software Hub that is associated with the primary and standby deployments. Use the oc get service command to find the exact values.
For example, if your primary deployment is db2wh-1616468282925295 and your
standby deployment is db2wh-1616469166354348, the commands would look like
this:
oc exec -it c-db2wh-1616468282925295-db2u-0 -- manage_hadr -enable_acr c-db2wh-1616469166354348-db2u-engn-svc:50000
oc exec -it c-db2wh-1616469166354348-db2u-0 -- manage_hadr -enable_acr c-db2wh-1616468282925295-db2u-engn-svc:50000
External clients
On external clients, run the following commands to enable HADR automatic client reroute:
oc exec -it primary-db2wh-svc-id-db2u-0 -- manage_hadr -enable_acr host_name_or_IP_address:NodePort
oc exec -it standby-db2wh-svc-id-db2u-0 -- manage_hadr -enable_acr host_name_or_IP_address:NodePort
Where host_name_or_IP_address is the IP address or hostname of the IBM Software Hub instance. Use the oc get service command to find the NodePort value for the service.
For example, if your primary deployment is db2wh-1616468282925295 and your
standby deployment is db2wh-1616469166354348, the commands would look like
this:
oc exec -it c-db2wh-1616468282925295-db2u-0 -- manage_hadr -enable_acr 9.121.221.159:31900
oc exec -it c-db2wh-1616469166354348-db2u-0 -- manage_hadr -enable_acr 9.121.221.159:31806
When ACR is enabled, follow the instructions at Connecting clients to the Db2 Warehouse HADR configuration.
For more information, see Db2 automatic client reroute with HADR.