Enabling S3 geo-replication

Virtuozzo Hybrid Infrastructure can store replicas of S3 cluster data and keep them up to date in multiple geographically distributed datacenters. Geo-replication reduces the response time for local S3 users accessing the data in a remote S3 cluster, or remote S3 users accessing the data in a local S3 cluster, as they do not need an Internet connection.

Geo-replication schedules the update of the replicas as soon as any data is modified. Its performance depends on the Internet connection speed, the redundancy mode, and cluster performance.

If you have multiple datacenters with enough free space, it is recommended to set up geo-replication between S3 clusters residing in these datacenters.

Prerequisites

  • S3 clusters are created, as described in Creating the S3 cluster.
  • Each cluster has its own SSL certificate signed by a global certificate authority.

To set up geo-replication between S3 clusters

Admin panel

  1. In the admin panel of a remote datacenter, open the Storage services > S3 > Geo-replication screen, and then click the home S3 storage.
  2. On the right pane, click Get token.
  3. In the Get token window, click Copy token below the Token section.

  4. In the admin panel of the local datacenter, open the Storage services > S3 > Geo-replication screen, and then click Add datacenter.
  5. In the Add datacenter window, enter the copied token, and then click Add.

  6. Configure the remote S3 storage the same way.

After you enable geo-replication for the clusters, you can replicate their data per bucket.

Command-line interface

  1. In the remote datacenter, run vinfra service s3 replication show token to get its token, and then copy this token. For example:

    # vinfra service s3 replication show token --max-value-length -1
    +-------+---------------------------------------------------------------------------+
    | Field | Value                                                                     |
    +-------+---------------------------------------------------------------------------+
    | token | eyJyZWFkYWJsZV9uYW1lIjogImhjaUhlYXQiLCAiaXNfc2VsZiI6IHRydWUsICJ1c2VyX3NlY |
    |       | 3JldF9rZXkiOiAiTnM3eWZOcVJ1RGQxRzVUc0ZCZ0VlcjNtWGgyRGJIMG1wanB1NkhVNyIsIC |
    |       | J1aWQiOiAiZGQ3MTZjY2VmNDE5OTNiZiIsICJ1cmwiOiAiaHR0cHM6Ly9zM3N0b3JhZ2UuZXh |
    |       | hbXBsZS5jb206NDQzIiwgInVzZXJfa2V5X2lkIjogIjgyNmYwYmUyMWNjMDcwZjJGUDhRIn0= |
    +-------+---------------------------------------------------------------------------+
  2. In the local datacenter, run vinfra service s3 replication add, using the token of the remote datacenter. For example:

    # vinfra service s3 replication add --token eyJ1c2VyX3<…>
  3. Configure the remote S3 storage the same way.

To check that S3 geo-replication is enabled, run vinfra service s3 replication list:

# vinfra service s3 replication list
+--------------+---------------+-------------------------------+---------+--------------+-----------------+
| uid          | readable_name | url                           | is_self | user_key_id  | user_secret_key |
+--------------+---------------+-------------------------------+---------+--------------+-----------------+
| dd716cc<...> | cluster1      | http://s3stor1.example.com:80 | True    | 826f0be<...> | Ns7yfNq<...>    |
| eff4d48<...> | cluster2      | http://s3stor2.example.com:80 | False   | cd3f6ae<...> | UmSuxYI<...>    |
+--------------+---------------+-------------------------------+---------+--------------+-----------------+

To replicate a bucket

  1. Open the Storage services > S3 > Buckets screen, and then select the bucket.
  2. Click Enable geo-replication on the right pane.

The Geo-replication column for this bucket will display Enabled and the bucket will be copied to the connected cluster.

To disable geo-replication of a bucket

  1. Open the Storage services > S3 > Buckets screen, and then select the bucket.
  2. Click Disable geo-replication on the right pane.

The Geo-replication column for this bucket will display Disabled. After geo-replication is disabled for a bucket, the data copied beforehand will remain, but the changes to it will no longer be replicated to the other S3 cluster.

To disable geo-replication between S3 clusters

Admin panel

  1. In the admin panel of a local datacenter, open the Storage services > S3 > Geo-replication screen, and then click the remote S3 storage.
  2. On the right pane, click Delete.
  3. Click Delete in the confirmation window.
  4. Configure the remote S3 storage the same way.

Command-line interface

  1. In the local datacenter, run vinfra service s3 replication delete using the UID of the remote datacenter. For example:

    # vinfra service s3 replication delete --id eff4d48<…>
  2. Configure the remote S3 storage the same way.

To check that S3 geo-replication is disabled, run vinfra service s3 replication list:

# vinfra service s3 replication list
+--------------+---------------+-------------------------------+---------+--------------+-----------------+
| uid          | readable_name | url                           | is_self | user_key_id  | user_secret_key |
+--------------+---------------+-------------------------------+---------+--------------+-----------------+
| dd716cc<...> | cluster1      | http://s3stor1.example.com:80 | True    | 826f0be<...> | Ns7yfNq<...>    |
+--------------+---------------+-------------------------------+---------+--------------+-----------------+