Disaster recovery

Configure and run

To configure Disaster recovery in ADBM, follow the steps:

  1. Using the ADB Control web interface, add a new cluster to which data from the source ADB cluster will be copied. Next, the added cluster will be called target or DR cluster. Note that both ADB Control and ADBM services should be added to the target cluster via ADCM.

  2. Open the Backup Manager page in the ADB Control web interface. Ensure that the source and target clusters are available on the page in the UP status.

    adbm dr
    Both clusters are available on the Backup Manager page
    CAUTION
    • To properly configure data copying, use two clusters with the same major version (the first two digits in the bundle number). For example, clusters with the 6.23.4 and 6.23.5 bundle versions can interact. But you cannot configure data copying between clusters with the 6.23.4 and 6.24.1 versions.

    • To restore data on a target ADB cluster from a backup created on another cluster, you need the same number of primary segments on both clusters. The rest of the cluster topology settings (such as mirroring, standby, number of host segments) do not affect the restore option.

  3. Add backup configurations for both clusters. Note that the source Repository section (which is defined for a source cluster) should describe the storage that is available for both clusters (for example, S3).

    Repository section for a source cluster
    adbm dr3
    Example of the Repository section filling for a source cluster
    Repository section for a target cluster
    adbm dr2
    Example of the Repository section filling for a target cluster
  4. To verify the successful result of data copy in the future, check which data is currently available in both clusters.

    Check a source cluster
    • List tables of the adb database via the \dt psql command:

      \dt

      Result:

                               List of relations
       Schema |      Name       | Type  |  Owner  |       Storage
      --------+-----------------+-------+---------+----------------------
       public | best_books      | table | gpadmin | heap
       public | book_type       | table | gpadmin | heap
       public | spatial_ref_sys | table | gpadmin | heap
       public | test            | table | gpadmin | append only columnar
       public | test2           | table | gpadmin | append only columnar
      (5 rows)
    • View the best_books table data:

      SELECT * FROM best_books;

      Result:

       id |   author   |         title         | public_year
      ----+------------+-----------------------+-------------
        1 | Harper Lee | To Kill a Mockingbird |        1960
      (1 row)
    Check a target cluster

     
    View tables of the adb database via the \dt psql command:

    \dt

    Result:

                      List of relations
     Schema |      Name       | Type  |  Owner  | Storage
    --------+-----------------+-------+---------+---------
     public | spatial_ref_sys | table | gpadmin | heap
    (1 row)
  5. On the Copy → Configurations tab of the Backup Manager page, click Create to add a new DR configuration.

    adbm dr4
    Switch to adding a DR configuration
  6. In the window that opens, select the source and target cluster names in the Source cluster and Target cluster fields accordingly.

    adbm dr5
    Select a cluster pair
  7. Click Save. As a result, the cluster pair is displayed on the Backup Manager → Copy → Configurations tab.

    adbm dr6
    Configuration is added
  8. Ensure that a source cluster has at least one restore point in ADBM. For this, a cluster should have a backup. Backups can be created either automatically according to the configured schedule or manually using the Backup action.

    adbm dr7
    A Full backup exists for a source cluster
  9. Click the add dark add light icon in the Actions column on the Backup Manager → Copy → Configurations tab to switch to configuring a data stream for the selected cluster pair.

    adbm dr8
    Switch to adding a stream
  10. On the Stream Info tab in the window that opens, fill in the following fields:

    • Restore type — a restore type. Currently, only Copy is available. The Streaming value is reserved for the future.

    • Restore point — the restore point at the moment of which you want to restore the source cluster databases in the target cluster.

    • Databases — a list of the source cluster databases to restore in the target cluster.

    • Repository path — a path to the repository that stores the source cluster backups. The default value is extracted from the current backup configuration.

    • Processes — a maximum number of processes to restore one segment.

    • Restore mirrors — a flag that indicates whether to restore data for mirrors and Standby if they exist in the cluster.

    • Delta — a flag that indicates the need to use checksums during the restore operation.

    • Force — a flag that indicates the need to completely overwrite data and tablespace paths in PostgreSQL.

      adbm dr9
      Fill in the Stream Info tab
  11. Click Next. On the Select Action tab, select an action from the drop-down list:

    • Create stream only — create a stream without automatic launch.

    • Create and start stream — create a stream with the following automatic launch.

      adbm dr10
      Fill in the Select Action tab
  12. Click Run. If the Create stream only option is selected in the previous step, the restore ability will be checked within the Disaster recovery start stream verify action; and the data stream should be done later manually. If the Create and start stream option is selected, the data stream starts automatically. In both variants, the Copy → Streams tab displays the created data stream. After the stream launch (manual or automatic) the Disaster recovery start stream copy action runs. This action, in turn, generates several subactions. You can see all of them on the Actions tab (for more details, see View actions in ADBM).

  13. As a successful result of all actions, the source cluster data is copied to the target cluster. To ensure this, you can run queries from the step 4.

    Check a target cluster
    • List tables of the adb database via the \dt psql command:

      \dt

      Result:

                               List of relations
       Schema |      Name       | Type  |  Owner  |       Storage
      --------+-----------------+-------+---------+----------------------
       public | best_books      | table | gpadmin | heap
       public | book_type       | table | gpadmin | heap
       public | spatial_ref_sys | table | gpadmin | heap
       public | test            | table | gpadmin | append only columnar
       public | test2           | table | gpadmin | append only columnar
      (5 rows)
    • View the best_books table data:

      SELECT * FROM best_books;

      Result:

       id |   author   |         title         | public_year
      ----+------------+-----------------------+-------------
        1 | Harper Lee | To Kill a Mockingbird |        1960
      (1 row)

Note that during each stream launch, the restore operation is created for the target cluster in ADBM. You can view it on the Backup Manager → Backup → <target cluster name> → Restores tab as well as a standard data restore that is launched via the Restore action. For restore operations made as a part of copying data between clusters, the Restore type column contains Copy. For more information, see View restores in ADBM.

adbm dr22
Data restore for the target cluster

DR configuration management

View a list of configurations

All cluster pairs between which DR is configured are displayed on the Copy → Configurations tab of the Backup Manager page.

adbm dr11
DR configurations on the Backup Manager → Copy → Configurations tab

The tab displays the following information.

The "Backup Manager → Copy → Configurations" tab fields
Field Description

Source cluster

The source cluster from which the data is to be copied

Target cluster

The target cluster to which the data is to be copied

Username

A login of the user who created the current configuration via the ADB Control web interface

Stream ID

A unique identifier of the stream that is currently running for a pair of clusters defined in the current configuration

Status

The stream status. See Status below

Restore type

The restore type that was selected during the stream configuration

Above the table with DR configurations, there are filters that you can use to select specific data. Available filters are listed below:

  • Source cluster — filter by the source cluster name (see Source cluster above). Select a value from the drop-down list.

  • Target cluster — filter by the target cluster name (see Target cluster above). Select a value from the drop-down list.

  • Username — filter by the user name (see Username above). Enter a full value.

adbm dr23
Filters on the Backup Manager → Copy → Configurations tab

Delete a configuration

To delete an existing configuration, follow the steps:

  1. Click the delete dark delete light icon in the Actions column on the Copy → Configurations tab of the Backup Manager page.

    adbm dr12
    Switch to deleting a configuration
  2. In the window that opens, confirm the operation by clicking Delete.

    adbm dr13
    Confirm the operation

    As a result, the configuration data is removed from the system and no longer displayed on the Backup Manager → Copy → Configurations tab.

    adbm dr14
    Configuration is removed

Stream management

View a list of streams

All streams that are created to copy data between two clusters are displayed on the Copy → Streams tab of the Backup Manager page.

adbm dr15
The Backup Manager → Copy → Streams tab

The tab displays the following information.

The "Backup Manager → Copy → Streams" tab fields
Field Description

Stream ID

A unique identifier of the stream

Source cluster

The source cluster from which the data is to be copied within the current stream

Target cluster

The target cluster to which the data is to be copied within the current stream

Username

A login of the user who created the current stream via the ADB Control web interface

Status

A stream status. Possible values:

  • Init — the stream is being initialized;

  • Impossible — the stream launch is impossible;

  • Ready — the stream is ready for data restore;

  • Restoring — the restore operation is running;

  • Streaming — reserved for the future;

  • Down — the stream launch is failed;

  • Terminating — the stream launch was terminated;

  • Restored — the stream launch is successful.

Start time

A stream creation timestamp in the DD/MM/YYYY HH:mm:ss format

Restore type

The restore type that was selected during the stream configuration

In the column headers of the table with a list of streams, there are filters that you can use to select specific data. To open a filter, click the openside dark openside light icon. For those columns where the set of possible values is limited (e.g. Status), you can select a value from the drop-down list. For some columns (e.g. Username), the search value should be entered. For columns that show date and time (e.g. Start time), the time range can be selected from the calendar.

The filtered dark filtered light icon means that a filter is defined for the column. To reset all filters, click Reset.

IMPORTANT

By default, the table on the Backup Manager → Copy → Streams tab shows the current-day streams. To view all streams, use the time filters.

View the stream details

To view the stream details, click the stream identifier (Stream ID) in the table on the Backup Manager → Copy → Streams tab.

adbm dr17
Select a stream

The next page contains two sections:

  • Overview

  • Stream history

The Overview section displays the general stream information.

adbm dr18
The Overview section
The "Overview" section fields
Field Description

Source cluster

A source cluster name

Target cluster

A target cluster name

Username

A login of the user who created the current stream via the ADB Control web interface

Date

A stream creation timestamp in the DD/MM/YYYY HH:mm:ss format

Restore ID

A uniqie identifier of the restore operation in the target cluster. To view the restore details, click the identifier

Restore type

The restore type that was selected during the stream configuration

Database

A list of databases that were selected during the stream configuration

Processes

A number of processes that was selected during the stream configuration

Flags

The flags that were selected during the stream configuration (see the Restore mirrors, Delta, Force flags above)

Action name

A name of the action within which the stream was launched. To view the action details, click the name

Restore point

An identifier of the restore point that was selected during the stream configuration

Repository path

A repository path that was selected during the stream configuration

The Stream history section displays the history of changing the selected stream status.

adbm dr19
The Stream history section
The "Stream history" tab fields
Field Description

Stream history ID

A unique identifier of the stream status change event

Status

A stream status at the time specified in the Date field. See Status above

Date

A timestamp of the stream status change event in the DD/MM/YYYY HH:mm:ss format

Run a stream manually

If you created the stream without running (see the Create stream only option above), you should run the stream manually. To do this, follow the steps:

  1. Apply the Copy action to the specified stream on the Backup Manager → Copy → Streams tab. To open a drop-down list with possible actions, click added actions dark added actions light in the Actions column. This button is enabled only for those actions that have available actions.

    adbm dr20
    Switch to the manual stream launch
  2. In the window that opens, confirm the operation by clicking Run.

    adbm dr21
    Confirm the operation

As a result, the Disaster recovery start stream copy runs. This action, in turn, generates several subactions. You can see all of them on the Actions tab (for more details, see View actions in ADBM). As a successful result of all actions, the source cluster data is copied to the target cluster.

Found a mistake? Seleсt text and press Ctrl+Enter to report it