Enabling geo-replication
Prerequisites
- Two backup storage clusters are deployed and registered in the Cloud Management Panel, as described in Provisioning backup storage space.
- All storage clusters are updated to the latest version.
- All storage clusters can reach each other via domain names on TCP port 44445.
- Each storage cluster can reach itself via its own domain name on TCP port 44445. This is especially important if the clusters are situated behind NAT.
To set up geo-replication between two storage clusters
Admin panel
-
On the cluster that will be configured as secondary, go to Storage services > Backup storage > Geo-replication. Click the copy icon next to the DNS name and UID fields to copy its DNS name and UID to clipboard.
-
On the cluster that will be configured as primary, go to Storage services > Backup storage > Geo-replication. Click Configure replication, and then do the following in the Configure replication window:
- Paste the DNS name and UID of the secondary cluster into the corresponding fields.
- Click Download configuration file to download the configuration file of the primary cluster to your local server.
- Click Done.
The primary cluster is now configured and ready to be connected to the secondary one, which needs to be configured next.
-
On the secondary cluster, click Configure replication, and then do the following in the Configure replication window:
- Select the Secondary cluster configuration type.
- Upload the configuration file of the primary cluster from your local server.
- Click Done.
The secondary cluster is now also configured and ready to be connected to the primary one.
If after configuring the secondary cluster, you need to change the configuration of the primary cluster for some reason, download the new configuration and upload it to the secondary cluster by clicking the upload icon next to the Configuration file field. Before doing so, make sure the primary cluster UID has not been changed. -
Back on the primary cluster, click Connect to enable replication between the two datacenters.
Command-line interface
-
On the cluster that will be configured as secondary, run
vinfra service backup geo-replication show
to learn its address and UID. For example:# vinfra service backup geo-replication show +-------+-------------------------------------------------------------+ | Field | Value | +-------+-------------------------------------------------------------+ | self | address: slave.example.com | | | datacenter_uid: e63a67388deb3c99d044eecbd7b79ad3-1577275849 | +-------+-------------------------------------------------------------+
-
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. For example:# vinfra service backup geo-replication master setup --slave-cluster-address \ slave.example.com --slave-cluster-uid e63a67388deb3c99d044eecbd7b79ad3-1577275849
-
On the primary cluster, run
vinfra service backup geo-replication master download-configs
to generate the configuration file of the primary cluster. For example:# vinfra service backup geo-replication master download-configs --conf-file-path master_dc.conf
-
Move the configuration file of the primary cluster to the secondary cluster using the standard Linux command-line tool. For example, by using
scp
:# scp master_dc.conf node005.vstoragedomain:/root/master_dc.conf root@node005.vstoragedomain's password:
-
On the secondary cluster, run
vinfra service backup geo-replication slave setup
to upload the configuration file of the primary cluster. For example:# vinfra service backup geo-replication slave setup --dc-config-file master_dc.conf
-
If for some reason, you need to cancel geo-replication, run
vinfra service backup geo-replication master cancel
on the primary cluster andvinfra service backup geo-replication slave cancel
on the secondary cluster. -
On the primary cluster, run
vinfra service backup geo-replication master establish
to establish a connection between the primary and secondary clusters. For example:# vinfra service backup geo-replication master establish