Setting up file system replication based DR solution on IAS

The disaster recovery solution must be enabled and configured on both IAS systems, the primary, and the secondary.

Before you begin

You can set up the DR solution between two freshly installed IAS systems (no user data on the primary IAS system). Or, you can also add the secondary DR system later to replicate from a primary system that is already in use and loaded with data. Note that any existing user data on the secondary system will be erased, as the process of DR setup replicates the data from the primary system.

Procedure

  1. Enable the disaster recovery solution by running the following steps on both IAS systems:
    1. Log in to each appliance as apuser.
    2. Run the following command:
      apdr enable --appliance-name <system_hostname>
  2. On one system at a time, run the next few steps pertaining to certificate authentication:
    1. On the first system, as the apuser create a temporary directory where you will be temporarily exporting the certificate created during apdr enable -a:
      mkdir <temp directory>
    2. Export the client certificate to the local directory you created:
      apdr certificate --export <temporary directory path you created>
    3. Copy the certificate to the second system in a temporary directory using any method. For example:
      scp <path/client.pem> apuser@<host>:~/tmp/
    4. On the second system, import the certificate you copied over:
      apdr certificate --import <path>/client.pem
    5. Delete the temporary copy of the certificate from your temporary directories on both systems after importing it:
      rm <temporary directory path>/client.pem
    6. On the second system, verify the certificate was imported correctly:
      apdr certificate --validate
      In the output, look for Certificates validated on local system.
    7. Restart the DR service on the second system to start it with certificate authentication:
      apdr disable
      apdr enable
    8. Repeat substeps a-g on the second system, so that both systems can communicate in each direction.
  3. Before setting up DR, ensure that any applications that are running on either IAS are disconnected. Run the following command on both systems:
    apstop -a
  4. Before configuring the IAS system, you can run the following health check command by logging in to the primary IAS system:
    apdr config -p <primary> --primary-ip-list <primary-ip-list> -s <secondary> --secondary-ip-list <secondary-ip-list> --check-only
    The command determines the network bandwidth, retransmissions and latency between the primary and secondary systems.
    Note: The recommended bandwidth between the primary and secondary systems is ~10 Gb/s.
    Example:
    [apuser@node0101 ~]# apdr config -p 9.30.0.46 --primary-ip-list 9.30.0.46 -s 9.30.1.156 --secondary-ip-list 9.30.1.156 --check-only
    
    Checking primary and secondary nodes
    Checking the specified ip addresses
    Getting APDR status
    Checking network statistics between both the systems
    Successfully submitted a network diagnostics job
    STATUS : SUCCEEDED
    
    
    +----------------------+--------------------+-------------------+---------------+
    | Route                |   Bandwidth (gbps) |   Retransmissions |   Latency (s) |
    |----------------------+--------------------+-------------------+---------------|
    | primary to secondary |               9.09 |               399 |          1016 |
    | secondary to primary |               9.27 |               353 |          1075 |
    +----------------------+--------------------+-------------------+---------------+
    
    WARNING: The bandwidth between the two DR machines is lower than recommended (~10 gigabits per second).
    You may still proceed with configuration, however you may experience slower replication than usual due to low bandwidth.
  5. Log in to the primary IAS system and run the following command:
    Important: Make sure that you specify names for the primary and secondary systems correctly. All the current database data of the secondary system will be erased as part of the setup. For more details on the apdr config command, see apdr command.
    apdr config --primary <primary> --secondary <secondary> --primary-ip-list <primary-ip-list> --secondary-ip-list <secondary-ip-list> --snapshot-interval <snapshot-interval> --scheduler-starttime <starthour> <startminute>
    Example output:
    [root@node0101 ~]# apdr config --primary sail74-t07 --secondary sail75-t07 --primary-ip-list  9.32.246.205,9.32.246.206,9.32.246.207 --secondary-ip-list 9.32.246.213,9.32.246.214,9.32.246.215 --snapshot-interval 21600 --scheduler-starttime 23 11
    checking results for apdr config: Checking primary and secondary nodes
    Checking the specified ip addresses
    Getting APDR  status
    Setting the configuration on both the systems
    Successfully configured DR at sail74-t07 and sail75-t07
    You can now proceed to do the DR setup using the command 'apdr setup'.
    Make sure you stop the database at Primary and Secondary via 'apstop' before proceeding with setup
  6. Initiate the DR setup process with the following command on the primary system:
    apdr setup 
    This command initiates the setup between the primary and secondary system and begins the replication of user data from the primary IAS to the secondary IAS.
    Example:
    [root@node0101 ~]# apdr setup
    Getting APDR status
    Starting conversion of Filesystems in both the systems
    Setting up DR between Primary and Secondary
    DR setup process between 9.30.96.159 [role=Primary] and 9.30.181.77 [role=Secondary] successfully initiated. Use the command 'apdr setup --status' to monitor the setup progress. 
  7. When the setup has been initiated, you can use the apdr setup --status --detail command to track the progress of the setup.

    Example output:

    [root@node0101 ~]# apdr setup --status --detail
    PRIMARY PROGRESS:                                           CURRENT PROGRESS:
    /opt/ibm/appliance/storage/scratch/db2archive               Done
    /opt/ibm/appliance/storage/head/home/db2inst1/db2/keystore  Done
    /opt/ibm/appliance/storage/data/db2inst1                    Done
    /opt/ibm/appliance/storage/local/db2inst1                   Done
    
    SECONDARY PROGRESS:                                         CURRENT PROGRESS:
    /opt/ibm/appliance/storage/scratch/db2archive               Done
    /opt/ibm/appliance/storage/head/home/db2inst1/db2/keystore  Done
    /opt/ibm/appliance/storage/data/db2inst1                    Done
    /opt/ibm/appliance/storage/local/db2inst1                   Done
    
  8. After confirming that the setup completed successfully, run the following commands on both, primary and secondary systems to make AFMDR ready for replication:
    apdr disable
    apdr enable
  9. When the setup process is completed, you can start the primary system by using the apstart command.
    Important: Don’t start the database on the secondary system.

Results

After the setup is completed, any newly applied data on the primary system is continuously replicated to the secondary every 15 seconds.