If the HADR databases are in different OpenShift® clusters, you must have NodePort-type
services for deployments to communicate with each other.
About this task
For details on creating these services, see Creating services to expose the HADR endpoints.
The specific NodePorts that are assigned to each service/database are required for the following
HADR configuration steps:
To determine the HADR NodePort that is associated with a Db2 or Db2 Warehouse deployment:
Procedure
-
Describe the HADR service that corresponds to the database deployment.
-
Find the NodePort that corresponds to the port for the database HADR role:
- Primary - db2u-hadrp
- Principal Standby – db2u-hadrs
- Auxiliary Standby 1 – db2u-hadra1
- Auxiliary Standby 2 – db2u-hadra2
In the following example, the c-db2oltp-primary-hadr-svc
service corresponds to
the primary database, and the NodePort for the primary deployment is 32457.
oc describe svc c-db2-primary-hadr-svc
#Output:
Name: c-db2-primary-hadr-svc
Namespace: zen
Labels: <none>
Annotations: <none>
Selector: app=db2-primary,type=engine
Type: NodePort
IP: 172.30.77.20
Port: db2u-hadrp 60006/TCP
TargetPort: 60006/TCP
NodePort: db2u-hadrp 32457/TCP
Endpoints: 10.254.27.150:60006
Port: db2u-hadrs 60007/TCP
TargetPort: 60007/TCP
NodePort: db2u-hadrs 31243/TCP
Endpoints: 10.254.27.150:60007
Port: db2u-hadra1 60008/TCP
TargetPort: 60008/TCP
NodePort: db2u-hadra1 30374/TCP
Endpoints: 10.254.27.150:60008
Port: db2u-hadra2 60009/TCP
TargetPort: 60009/TCP
NodePort: db2u-hadra2 30977/TCP
Endpoints: 10.254.27.150:60009
Session Affinity: None
External Traffic Policy: Cluster
Events: <none>
In the following example, the c-db2-standby-hadr-svc
service corresponds to the
principal standby database, and the NodePort for the standby deployment is 31384.
oc describe svc c-db2-standby-hadr-svc
# Output:
Name: c-db2-standby-hadr-svc
Namespace: zen
Labels: <none>
Annotations: <none>
Selector: app=db2-standby,type=engine
Type: NodePort
IP: 172.30.247.77
Port: db2u-hadrp 60006/TCP
TargetPort: 60006/TCP
NodePort: db2u-hadrp 32649/TCP
Endpoints: 10.254.21.80:60006
Port: db2u-hadrs 60007/TCP
TargetPort: 60007/TCP
NodePort: db2u-hadrs 31384/TCP
Endpoints: 10.254.21.80:60007
Port: db2u-hadra1 60008/TCP
TargetPort: 60008/TCP
NodePort: db2u-hadra1 30473/TCP
Endpoints: 10.254.21.80:60008
Port: db2u-hadra2 60009/TCP
TargetPort: 60009/TCP
NodePort: db2u-hadra2 30652/TCP
Endpoints: 10.254.21.80:60009
Session Affinity: None
External Traffic Policy: Cluster
Events: <none>