Setting up the HADR configuration for Db2

After you configure the service endpoints, you can quickly set up the high availability disaster recovery (HADR) configuration by running a script that performs the setup steps.

Before you begin

  • Determine the HADR ports corresponding to each database.
  • If databases are in different OpenShift projects on the same cluster, also determine the IP addresses for each HADR service.
  • Ensure you have the etcd endpoint (IP address/hostname and port) available for HADR setup. See Setting up an etcd store for HADR in Db2.

    For a development-only environment with all databases on a single OpenShift cluster, you can use the built-in etcd store of the primary database.

About this task

The script:

  • Generates and sets the Db2 HADR database configuration parameters
  • On the primary database, generates an offline backup of the database and the encryption keystore.
  • On the standby databases, restores the offline backup image and encryption keystore that were copied from the primary database.

For full command syntax and parameter descriptions, see setup_config_hadr script for Db2.

To set up HADR, follow these steps:

Procedure

  1. Set up HADR by using the setup_config_hadr script on the primary database pod.
  2. Copy the database backup image and keystore file in the backup storage area (/mnt/backup/) from the primary database to the standby database or databases by using rsync.
    Note: If the backup volume is shared between the primary and standby databases, you can skip this step.
  3. Set up HADR using the setup_config_hadr script on each standby database pod.