4.6. Managing Backup Cluster Geo-replication

Important

To enable geo-replication, the backup clusters must be able to reach each other via domain names on TCP port 44445.

To enable geo-replication between two backup clusters, execute the following commands (see examples in the sections below):

  1. On the cluster that will be configured as secondary, run vinfra service backup geo-replication show to learn its address and UID.
  2. On the cluster that will be configured as primary, run vinfra service backup geo-replication master setup, using the address and UID of the secondary cluster.
  3. On the primary cluster, run vinfra service backup geo-replication master download-configs to generate the configuration file of the primary cluster.
  4. Move the configuration file of the primary cluster to the secondary cluster using the standard Linux command-line tool, for example, scp.
  5. On the secondary cluster, run vinfra service backup geo-replication slave setup to upload the configuration file of the primary cluster.
  6. On the primary cluster, run vinfra service backup geo-replication master establish to establish a connection between the primary and secondary clusters.
  7. On one of the clusters, run vinfra service backup geo-replication show to check that geo-replication has been successfully enabled.

4.6.1. vinfra service backup geo-replication show

Display the geo-replication configuration:

usage: vinfra service backup geo-replication show

Example:

# vinfra service backup geo-replication show
+-------+-------------------------------------------------------------+
| Field | Value                                                       |
+-------+-------------------------------------------------------------+
| self  | address: slave.example.com                                  |
|       | datacenter_uid: e63a67388deb3c99d044eecbd7b79ad3-1577275849 |
+-------+-------------------------------------------------------------+

This command shows the geo-replication configuration of the secondary cluster.

4.6.2. vinfra service backup geo-replication master setup

Configure geo-replication for the primary cluster:

usage: vinfra service backup geo-replication master setup --slave-cluster-address
                                                          <slave-cluster-address>
                                                          --slave-cluster-uid
                                                          <slave-cluster-uid>
--slave-cluster-address <slave-cluster-address>
Secondary cluster DNS name
--slave-cluster-uid <slave-cluster-uid>
Secondary cluster UID

Example:

# vinfra service backup geo-replication master setup --slave-cluster-address \
slave.example.com --slave-cluster-uid e63a67388deb3c99d044eecbd7b79ad3-1577275849
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | 07df4a57-704e-47de-b681-615ee0c26a21 |
+---------+--------------------------------------+

This command creates a task to configure geo-replication for the primary backup cluster.

Task outcome:

# vinfra task show 07df4a57-704e-47de-b681-615ee0c26a21
+---------+----------------------------------------------------+
| Field   | Value                                              |
+---------+----------------------------------------------------+
| details |                                                    |
| name    | backend.tasks.message_dispatcher.CommandDispatcher |
| result  |                                                    |
| state   | success                                            |
| task_id | 07df4a57-704e-47de-b681-615ee0c26a21               |
+---------+----------------------------------------------------+

4.6.3. vinfra service backup geo-replication master download-configs

Download the geo-replication configuration file of the primary cluster:

usage: vinfra service backup geo-replication master download-configs
                                                    [--conf-file-path <conf-file-path>]
--conf-file-path <conf-file-path>
Path where the configuration file will be downloaded

Example:

# vinfra service backup geo-replication master download-configs \
--conf-file-path master_dc.conf

This command downloads the geo-replication configuration file of the primary cluster to the specified file.

4.6.4. vinfra service backup geo-replication slave setup

Configure geo-replication for the secondary cluster:

usage: vinfra service backup geo-replication slave setup
                                                   --dc-config-file <dc-config-file>
--dc-config-file <dc-config-file>
Path to the configuration file of the primary cluster on the local server

Example:

# vinfra service backup geo-replication slave setup --dc-config-file master_dc.conf
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | d34b3a4f-6e16-4e60-b20a-844052945d3e |
+---------+--------------------------------------+

This command creates a task to configure geo-replication for the secondary backup cluster.

Task outcome:

# vinfra task show d34b3a4f-6e16-4e60-b20a-844052945d3e
+---------+----------------------------------------------------+
| Field   | Value                                              |
+---------+----------------------------------------------------+
| details |                                                    |
| name    | backend.tasks.message_dispatcher.CommandDispatcher |
| result  |                                                    |
| state   | success                                            |
| task_id | d34b3a4f-6e16-4e60-b20a-844052945d3e               |
+---------+----------------------------------------------------+

4.6.5. vinfra service backup geo-replication master establish

Establish a connection between the primary and secondary clusters to enable geo-replication:

usage: vinfra service backup geo-replication master establish

Example:

# vinfra service backup geo-replication master establish
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | 014903e4-c2e6-4e03-b1af-06c28b672f6e |
+---------+--------------------------------------+

This command creates a task to connect the primary and secondary clusters to enable geo-replication.

Task outcome:

# vinfra task show 014903e4-c2e6-4e03-b1af-06c28b672f6e
+---------+----------------------------------------------------+
| Field   | Value                                              |
+---------+----------------------------------------------------+
| details |                                                    |
| name    | backend.tasks.message_dispatcher.CommandDispatcher |
| result  |                                                    |
| state   | success                                            |
| task_id | 014903e4-c2e6-4e03-b1af-06c28b672f6e               |
+---------+----------------------------------------------------+

4.6.6. vinfra service backup geo-replication slave update-certificates

Update the primary cluster’s configuration on the secondary cluster:

usage: vinfra service backup geo-replication slave update-certificates
                                                   --dc-config-file <dc-config-file>
--dc-config-file <dc-config-file>
Path to the configuration file of the primary cluster

Example:

# vinfra service backup geo-replication slave update-certificates \
--dc-config-file primary_dc_updated.conf
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | 0ab89de1-b02d-426b-a03c-b1922e610594 |
+---------+--------------------------------------+

This command creates a task to update the configuration of the primary backup cluster.

Task outcome:

# vinfra task show 0ab89de1-b02d-426b-a03c-b1922e610594
+---------+----------------------------------------------------+
| Field   | Value                                              |
+---------+----------------------------------------------------+
| details |                                                    |
| name    | backend.tasks.message_dispatcher.CommandDispatcher |
| result  |                                                    |
| state   | success                                            |
| task_id | 0ab89de1-b02d-426b-a03c-b1922e610594               |
+---------+----------------------------------------------------+

4.6.7. vinfra service backup geo-replication master disable

Disable geo-replication on the primary cluster:

usage: vinfra service backup geo-replication master disable

Example:

# vinfra service backup geo-replication master disable
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | dc2bb8ae-8e32-4d37-8d97-4c4c46189d27 |
+---------+--------------------------------------+

This command creates a task to disable geo-replication on the primary cluster.

Task outcome:

# vinfra task show dc2bb8ae-8e32-4d37-8d97-4c4c46189d27
+---------+----------------------------------------------------+
| Field   | Value                                              |
+---------+----------------------------------------------------+
| details |                                                    |
| name    | backend.tasks.message_dispatcher.CommandDispatcher |
| result  |                                                    |
| state   | success                                            |
| task_id | dc2bb8ae-8e32-4d37-8d97-4c4c46189d27               |
+---------+----------------------------------------------------+

4.6.8. vinfra service backup geo-replication slave promote-to-master

Promote the secondary cluster to primary in the geo-replication configuration:

usage: vinfra service backup geo-replication slave promote-to-master

Example:

# vinfra service backup geo-replication slave promote-to-master
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | 083a7d6e-3be8-490f-b468-a3f84abb3487 |
+---------+--------------------------------------+

This command creates a task to promote the secondary cluster to primary in the geo-replication configuration.

Task outcome:

# vinfra task show 083a7d6e-3be8-490f-b468-a3f84abb3487
+---------+----------------------------------------------------+
| Field   | Value                                              |
+---------+----------------------------------------------------+
| details |                                                    |
| name    | backend.tasks.message_dispatcher.CommandDispatcher |
| result  |                                                    |
| state   | success                                            |
| task_id | 083a7d6e-3be8-490f-b468-a3f84abb3487               |
+---------+----------------------------------------------------+

4.6.9. vinfra service backup geo-replication slave cancel

Cancel geo-replication for the secondary cluster:

usage: vinfra service backup geo-replication slave cancel

Example:

# vinfra service backup geo-replication slave cancel
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | ad977d03-995c-4677-9308-5e73ec8a2821 |
+---------+--------------------------------------+

This command creates a task to cancel geo-replication for the secondary backup cluster.

Task outcome:

# vinfra task show ad977d03-995c-4677-9308-5e73ec8a2821
+---------+----------------------------------------------------+
| Field   | Value                                              |
+---------+----------------------------------------------------+
| details |                                                    |
| name    | backend.tasks.message_dispatcher.CommandDispatcher |
| result  |                                                    |
| state   | success                                            |
| task_id | ad977d03-995c-4677-9308-5e73ec8a2821               |
+---------+----------------------------------------------------+

4.6.10. vinfra service backup geo-replication master cancel

Cancel geo-replication for the primary cluster:

usage: vinfra service backup geo-replication master cancel

Example:

# vinfra service backup geo-replication master cancel
+---------+--------------------------------------+
| Field   | Value                                |
+---------+--------------------------------------+
| task_id | e1931274-24a5-491e-a5f8-d24fdf4385f7 |
+---------+--------------------------------------+

This command creates a task to cancel geo-replication for the primary backup cluster.

Task outcome:

# vinfra task show e1931274-24a5-491e-a5f8-d24fdf4385f7
+---------+----------------------------------------------------+
| Field   | Value                                              |
+---------+----------------------------------------------------+
| details |                                                    |
| name    | backend.tasks.message_dispatcher.CommandDispatcher |
| result  |                                                    |
| state   | success                                            |
| task_id | e1931274-24a5-491e-a5f8-d24fdf4385f7               |
+---------+----------------------------------------------------+