Updating replication external ports at the Db2 data target

When you disable and then re-enable replication, you need to update the external port numbers in the replication metadata.

About this task

This procedure uses a script to update the port numbers for the external REST server, IBM® MQ for the capture process, and MQ for the apply process.

Note: If you are not using an haproxy configuration, you do not need to run the qrep-expose-nodeports.sh script that is described in this procedure.

Procedure

  1. Find the external port numbers for the target replication pod:
    oc get svc|grep db2u-1640057971423353-qrep
    c-db2u-1640057971423353-qrep-mq-svc     NodePort    172.30.4.126     <none>        1414:30415/TCP,1415:32475/TCP      48s
    c-db2u-1640057971423353-qrep-rest-svc   NodePort    172.30.65.180    <none>        9444:31452/TCP    
    In this case, the numbers are 31452 for the REST server port, 30415 for the capture MQ port, and 32475 for the apply MQ port.
  2. Get the external Db2 TLS port number for example pod db2u-1640057971423353:
    oc get svc | grep engn | grep db2u-1640057971423353
    c-db2u-1640057971423353-db2u-engn-svc   NodePort    172.30.132.82    <none>        50000:32584/TCP,50001:30689/TCP
  3. Exec into the target replication pod:
    oc get pod|grep db2-1640057971423353-qrep
    c-db2u-1640057971423353-qrep-7878599d84-bl5qv     1/1     Running     0          72m
    oc exec -it c-db2u-1640057971423353-qrep-7878599d84-bl5qv  bash
  4. Run the bludr-change-ports.sh script, using the numbers from Step 2 for the REST port (-rp), capture port (-cp), apply port (-ap), and db2 port (-dp). The script file is inside the qrep container at /opt/ibm/bludr/scripts/bin.
    ./bludr-change-ports.sh -rt target -rd target -rp 31452 -cp 30415 -ap 32475 -dp 30689 -sa source-db-alias -ta target-db-alias
  5. On the corresponding source replication pod, run the bludr-change-ports.sh script, this time specifying -rd source
    ./bludr-change-ports.sh -rt target -rd source -rp 30939 -cp 31703 -ap 31953 -dp 30689 -sa source-db-alias -ta target-db-alias
  6. On both the source and target pods, run the bludr-restart.sh script to restart replication:
    /opt/ibm/bludr/scripts/bin/bludr-restart.sh