Enable Two-Way Server-Side Bucket Replication

The procedure on this page creates a new bucket replication rule for two-way “active-active” synchronization of objects between Buckit buckets.

Active-Active Replication synchronizes data between two remote clusters.

This tutorial covers configuring Active-Active replication between two Buckit clusters. For a tutorial on multi-site replication between three or more Buckit clusters, see Enable Multi-Site Server-Side Bucket Replication.

Requirements

You must meet all of the basic requirements for bucket replication described in Bucket Replication Requirements.

In addition, to set up active-active bucket replication, you must meet the following additional requirements:

Access to Both Clusters

You must have network access and login credentials with required permissions to both deployment to set up active-active bucket replication.

You can access the deployments by installing bm and using the command line. Use the bm alias set command to create an alias for both Buckit deployments.

Alias creation requires specifying an access key for a user on the deployment. This user must have permission to create and manage users and policies on the deployment.

Specifically, ensure the user has at minimum:

Considerations

Use Consistent Replication Settings

Buckit supports customizing the replication configuration to enable or disable the following replication behaviors:

  • Replication of delete operations

  • Replication of delete markers

  • Replication of existing objects

  • Replication of metadata-only changes

When configuring replication rules for a bucket, ensure that both Buckit deployments participating in active-active replication use the same replication behaviors to ensure consistent and predictable synchronization of objects.

Replication of Existing Objects

Buckit supports automatically replicating existing objects in a bucket.

Buckit requires explicitly enabling replication of existing objects using the bm replicate add --replicate or bm replicate update --replicate and including the existing-objects replication feature flag. This procedure includes the required flags for enabling replication of existing objects.

Replication of Delete Operations

Buckit supports replicating delete operations onto the target bucket. Specifically, Buckit can replicate versioning Delete Markers and the deletion of specific versioned objects:

  • For delete operations on an object, Buckit replication also creates the delete marker on the target bucket.

  • For delete operations on versions of an object, Buckit replication also deletes those versions on the target bucket.

Buckit requires explicitly enabling replication of delete operations using the bm replicate add --replicate or bm replicate update --replicate. This procedure includes the required flags for enabling replication of delete operations and delete markers.

Buckit does not replicate delete operations resulting from the application of lifecycle management expiration rules. Configure matching expiration rules on both the source and destination bucket to ensure consistent application of object expiration.

See Replication of Delete Operations and Object Deletion for more complete documentation.

Multi-Site Replication

Buckit supports configuring multiple remote targets per bucket or bucket prefix. This enables configuring multi-site active-active replication between Buckit deployments.

This procedure covers active-active replication between two Buckit sites. You can repeat this procedure for each “pair” of Buckit deployments in the replication mesh. For a dedicated tutorial, see Enable Multi-Site Server-Side Bucket Replication.

Procedure

Configure Two-Way Bucket Replication Using the Command Line bm

This procedure creates two-way, active-active replication between two Buckit deployments.

This procedure assumes you have already defined an alias for each deployment as a user with the necessary replication permissions.

1) Create a New Bucket Replication Rule on Each Deployment

Use the bm replicate add command to add a new replication rule to each Buckit deployment.

bm replicate add ALIAS/BUCKET \
   --remote-bucket 'https://USER:PASSWORD@HOSTNAME:PORT/BUCKET' \
   --replicate "delete,delete-marker,existing-objects"
  • Replace ALIAS with the alias of the origin Buckit deployment. The name must match the bucket specified when creating the remote target in the previous step.

  • Replace BUCKET with the name of the bucket to replicate from on the origin deployment.

  • Replace the --remote-bucket to specify the remote Buckit deployment and bucket to which the ALIAS/BUCKET replicates.

    The USER:PASSWORD must correspond to a user on the remote deployment with the necessary replication permissions.

    The HOSTNAME:PORT must resolve to a reachable Buckit instance on the remote deployment. The BUCKET must exist and otherwise meet all other replication requirements.

  • The --replicate "delete,delete-marker,existing-objects" flag enables the following replication features:

    See bm replicate add --replicate for more complete documentation. Omit any field to disable replication of that component.

Specify any other supported optional arguments for bm replicate add.

Repeat this step on the other Buckit deployment. Change the ALIAS and --remote-bucket values to correspond to the first deployment.

You should have two replication rules configured at the conclusion of this step - one created on each deployment that points to the bucket on the other deployment. Use the bm replicate ls command to verify the created replication rules.

2) Validate the Replication Configuration

Use bm cp to copy a new object to the replicated bucket on one of the deployments.

bm cp ~/foo.txt ALIAS/BUCKET

Use bm ls to verify the object exists on the destination bucket:

bm ls ALIAS/BUCKET

Repeat this test by copying another object to the second deployment and verifying the object replicates to the first deployment.

Once both objects exist on both deployments, you have successfully set up two-way, active-active replication between Buckit buckets.

See also