Documentation

Documentation

Enable Multi-Site Server-Side Bucket Replication

The procedure on this page configures automatic server-side bucket replication between multiple MinIO deployments. Multi-Site Active-Active replication builds on the Enable Two-Way Server-Side Bucket Replication procedure with additional considerations required to ensure predictable replication behavior across all sites.

Active-Active Replication synchronizes data between multiple remote deployments.

Multi-Site Active-Active replication configurations can span multiple racks, datacenters, or geographic locations. Complexity of configuring and maintaining multi-site configurations generally increase with the number of sites and size of each site. Enterprises looking to implement multi-site replication should consider leveraging MinIO SUBNET support to access the expertise, planning, and engineering resources required for addressing that use case.

See also

Requirements

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

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

Access to All Clusters

You must have network access and log in credentials with correct permissions to all deployments to set up multi-site active-active bucket replication.

You can access the deployments by logging in to the MinIO Console for each deployment or by installing mc and using the command line.

If using the command line, use the mc alias command to create an alias for each MinIO deployment. 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

Click to expand any of the following:

Use Consistent Replication Settings

MinIO 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 all MinIO deployments participating in multi-site replication use the same replication behaviors to ensure consistent and predictable synchronization of objects.

Replication of Existing Objects

MinIO supports automatically replicating existing objects in a bucket.

MinIO requires explicitly enabling replication of existing objects using the mc replicate add --replicate or mc replicate edit --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

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

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

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

MinIO requires explicitly enabling replication of delete operations using the mc replicate add --replicate or mc replicate edit --replicate. This procedure includes the required flags for enabling replication of delete operations and delete markers.

MinIO does not replicate delete operations resulting from the application of lifecycle management expiration rules. Configure matching expiration rules for the bucket on all replication sites to ensure consistent application of object expiration.

Procedure

This procedure requires repeating steps for each MinIO deployment participating in the multi-site replication configuration. Depending on the number of deployments, this procedure may require significant time and care in implementation. MinIO recommends reading through the procedure before attempting to implement the documented steps.

Configure Multi-Site Bucket Replication Using the MinIO Console

1) Create the Replication Rules

  1. Log in to the MinIO Console for the deployment

  2. Select the Manage button for the bucket to replicate

    After a successful log in, the MinIO Console shows a list of buckets with options to manage or explore each bucket.
  3. Select the Replication section

    After selecting a bucket to manage, MinIO shows summary information about the bucket as well as a navigation list of pages for adjusting the bucket configuration.
  4. Select Add Replication Rule +

  5. Complete the requested information:

    Field

    Description

    Priority

    Enter a number value to indicate the order in which to process replication rules for the bucket. 1 indicates the highest importance.

    Target URL

    The URL of the deployment to replicate data to.

    Use TLS

    Leave the toggle in the ON position if the destination deployment uses TLS. Otherwise, move the toggle to the OFF position.

    Access Key

    The user name to use on the destination deployment. The user must have write access to the bucket to replicate to.

    Secret Key

    The password for the provided Access Key.

    Target Bucket

    The bucket at the destination to write the data to. The target bucket may have the same name as the origin bucket, depending on the destination bucket location.

    Region

    The AWS resource region location of the destination deployment.

    Replication mode

    Leave the default selection of Asynchronous to allow MinIO to replicate data after the write operation completes on the origin ment. Select Synchronous to attempt to complete the replication of the object during its write operation.

    While synchronous replication may result in more reliable synchronization between the origin and destination buckets, it may also increase the time of each write operation.

    Bandwidth

    Specify the maximum amount of bandwidth the replication process can use while replicating data. Enter a number and select a data unit.

    Health Check Duration

    The maximum length of time in seconds MinIO should spend verifying the health of the replicated data on the destination bucket.

    Storage Class

    The class of storage to use on the destination deployment for the replicated data. Valid values are either STANDARD or REDUCED_REDUNDANCY.

    Object Filters

    Limit which objects to replicate from the bucket by Prefix or tags. If you enter multiple tags, the objects must match all tag values.

    Metadata Sync

    Leave selected to also replicate the object’s metadata file. Otherwise, move the toggle to the Off position.

    Delete Markers

    Leave selected to also replicate MinIO’s indication that an object has been deleted and should also be marked deleted at the ation bucket. Otherwise, move the toggle to the Off position to prevent marking the object as deleted in the destination bucket.

    Deletes

    Leave selected to allow replication of the deletion of versions of an object. Otherwise, move the toggle to the Off position to not replicate deletion of object versions.

  6. Select Save to finish adding the replication rule

Repeat the above steps to create a rule from this deployment to each of the other target deployments.

Then, repeat the above steps on each of the other deployments in the multi-site setup so that each deployment has a separate replication rule for all of the other deployments.

2) Validate the Replication Configuration

  1. Go to the Buckets section of the MinIO Console

    The default screen when logging into the MinIO Console. The screen shows a list of the buckets available in the Deployment with options to Manage or Browse the bucket contents.
  2. Select the Browse button for the bucket you added replication to

    The contents of a bucket display after selecting to Browse the MinIO bucket. Options including to Rewind, Refresh, or Upload contents.
  3. Select the Upload button to add a new object to the bucket

  4. Select Upload File

  5. Use the interface to add a new object to the bucket

  6. Go to the other deployment’s console and select the destination bucket defined in the replication

Repeat this test on each deployment by copying a new unique file and checking that the file replicates to each of the other deployments.

Configure Multi-Site Bucket Replication Using the Command Line (mc)

This procedure uses the placeholder ALIAS to reference the alias each MinIO deployment being configured for replication. Replace these values with the appropriate alias for each MinIO deployment.

This procedure assumes each alias corresponds to a user with the necessary replication permissions.

1) Create Replication Remote Targets

Use the mc admin bucket remote add command to create a replication target from each deployment to the appropriate bucket on the destination deployment. A bucket may have multiple remote targets to different target buckets. No two targets can resolve from one bucket to the same remote bucket.

mc admin bucket remote add ALIAS/BUCKET                    \
   https://RemoteUser:Password@HOSTNAME/BUCKETDESTINATION  \
   --service "replication"
  • Replace ALIAS with the alias of the MinIO deployment that acts as the origin for the replication.

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

  • Replacete RemoteUser with the user name that has the necessary replication permissions

  • Replace Password with the secret key for the RemoteUser.

  • Replace HOSTNAME with the URL of the destination deployment.

  • Replace BUCKETDESTINATION with the name of the bucket to replicate to on the destination deployment.

The command returns an ARN <Amazon Resource Name> similar to the following:

Role ARN = 'arn:minio:replication::<UUID>:BUCKET'

Copy the ARN to use in the next step, noting the MinIO deployment.

Repeat these instructions for each remote MinIO deployment participating in the multi-site replication configuration.

For example, a multi-site replication configuration consisting of three MinIO deployments minio1, minio2, and minio3 requires repeating this step twice on each deployment. Specifically:

  • The minio1 deployment requires defining separate remote targets for minio2 and for minio3.

  • The minio2 deployment requires defining separate remote targets for minio1 and for minio3.

  • The minio3 deployment requires defining separate remote targets for minio1 and for minio2.

More than three deployments requires additional remote targets on each deployment to create the required targets for each origin and destination bucket compination.

Record the ARN generated for each remote and note which origin-destination bucket combination you generated the ARN for.

2) Create New Bucket Replication Rules

Use the mc replicate add command to add a new replication rule to each MinIO deployment.

mc replicate add ALIAS/BUCKET \
   --remote-bucket 'arn:minio:replication::<UUID>:DESTINATIONBUCKET' \
   --replicate "delete,delete-marker,existing-objects"
  • Replace ALIAS with the alias of the origin MinIO 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 value with the ARN for the destination bucket determined in the first step. Ensure you specify the ARN created on the origin deployment. You can use mc admin bucket remote ls to list all remote ARNs configured on the deployment.

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

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

Specify any other supported optional arguments for mc replicate add.

Repeat these commands for each remote MinIO deployment participating in the multi-site replication configuration. For example, a multi-site replication configuration consisting of MinIO deployments minio1, minio2, and minio3 would require repeating this step on each deployment for each remote.

Specifically, in this scenario, perform this step twice on each deployment:

  • On the minio1 deployment, once for a rule for minio2 and again for a separate rule for minio3.

  • On the minio2 deployment, once for a rule for minio1 and again for a separate rule for minio3.

  • On the minio3 deployment, once for a rule for minio1 and again for a separate rule for minio2.

3) Validate the Replication Configuration

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

mc cp ~/foo.txt ALIAS/BUCKET

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

mc ls ALIAS/BUCKET

Repeat this test on each deployment by copying a new unique file and checking that the file replicates to each of the other deployments.

You can also use mc stat to check the file to check the current replication stage of the object.