Updated on 2024-04-16 GMT+08:00

Cross-Cluster Replication

Scenarios

Cross-cluster replication provides the capability for data disaster recovery across AZs, catering to your needs for cross-AZ backup in the same region.

Each OBS bucket must belong to a region, AZ, and cluster. You can use cross-cluster replication to implement cross-AZ disaster recovery. Specifically, replicate the data in a bucket (source bucket) in one AZ to the bucket (destination bucket) in a cluster in another AZ. If one AZ is faulty, data in the other AZ can still be used to ensure service continuity.

For a cross-cluster replication rule, you can configure it to match a pre-defined object prefix so that objects with the prefix will be replicated. Alternatively, you can configure the rule to apply to the entire bucket so that all objects in the bucket will be replicated. Objects replicated to the destination bucket are precise copies of objects in the source bucket. These objects have the same names, metadata, content, sizes, last modification time, creators, version IDs, user-defined metadata, and ACLs.

Contents Replicated

After the cross-cluster replication rule is enabled, objects that meet the following conditions are copied to the destination bucket:

  • Newly uploaded objects
  • Updated objects. For example, the object content is updated or the ACL information of a copied object is updated.
  • Historical objects in a bucket (The function of synchronizing existing objects must be enabled.)

Constraints

  • By default, objects uploaded before cross-cluster replication is enabled are not replicated to the destination bucket.
  • The source bucket and destination bucket must belong to different AZs in the same region.
  • The versioning status of the source and destination buckets must keep the same.
  • Objects in a source bucket can be copied to only one destination bucket, and cannot be copied again from the destination bucket to another bucket. For example, bucket A and bucket B are in two different AZs. You can copy data from bucket A to bucket B or the other way round. However, data copies in either bucket A or bucket B cannot be replicated anymore.
  • Only when versioning is enabled for both the source and destination buckets, deleting an object from the source bucket without specifying a version will result in the deletion of the object from the destination bucket. In other situations, deletion operations are not synchronized to the destination bucket.
  • For an enabled cross-cluster replication rule, if you change the versioning status of the destination bucket, the replication of objects will fail. If you want to change the versioning status of the source bucket, delete the replication configuration first, and then make the change.
  • Ensure that owners of the source and destination buckets have the read and write permissions to the two buckets. Otherwise, data cannot be synchronized. If the system does not have the permissions to read the source bucket or write the destination bucket due to read/write permission errors, objects cannot be copied successfully, and such replication will not be resumed even if the permission error is rectified.
  • If the owner of objects in the source bucket is not the owner of the source bucket, the object owner needs to grant the source bucket owner the object read and ACL read permissions of the object through the object ACL. If the source bucket and destination bucket belong to different owners, the destination bucket owner needs to configure a bucket policy that grants the source bucket owner the ReplicateObject and ReplicateDelete permissions.
  • For a source bucket, you can create only one cross-cluster replication rule that applies to the entire bucket for replication of all objects in the bucket. However, you can create a maximum of 100 cross-cluster replication rules based on object prefixes for the replication of objects that match the prefixes.
  • OBS currently only supports the replication between one source bucket and one destination bucket. Replication from one source bucket to multiple destination buckets is not supported. The destination bucket can be modified. However, modifying the destination bucket will change the destination bucket of all existing rules.
  • If you delete the OBS agency for an enabled cross-cluster replication rule, the object replication will be in the FAILED status.
  • Do not delete, overwrite object replicas in the destination bucket, or modify their ACLs, which may cause inconsistency of latest object versions or permission control settings between the destination bucket and the source bucket.
  • If cross-cluster or cross-region replication has been configured for a bucket, configuring another replication policy will overwrite the existing one.

Procedure

  1. In the navigation pane, click Cross-Cluster Replication.
  2. Click Create Rule. The Create Cross-Cluster Replication Rule dialog box is displayed.
  3. Configure the cross-cluster replication rule according to your service needs. For details about the parameters, see Table 1.

    Table 1 Cross-cluster replication parameters

    Parameter

    Description

    Status

    Indicates whether the rule is enabled or disabled after being created. The versioning status of the source and destination buckets must keep the same.

    Source bucket

    Replicate

    Indicates the objects the rule will apply to.

    • All objects: The rule applies to all objects in the bucket.
    • Match by prefix: The rule applies only to objects with the specified prefix.

    Prefix

    • To apply the rule to objects with the specified prefix, you must set Prefix to a value no longer than 1,023 characters.
    • If the specified prefix overlaps with the prefix of an existing rule, OBS regards these two rules as one and forbids you to configure the one you are configuring. For example, if there is already a rule with prefix abc in OBS, you cannot configure another rule whose prefix starts with ab or abcd.
    • To copy a folder, end the prefix with a slash (/), for example, imgs/.

    Synchronize Existing Objects

    Indicates whether to synchronize the objects that were already in the bucket before the rule configuration to the destination bucket. By default, these objects are not synchronized.

    Historical objects will be replicated only 15 minutes later a cross-cluster replication rule was configured.

    This option is available only when the administrator enables it in the background.

    Destination bucket

    Bucket

    Indicates the destination bucket. The destination bucket cannot be in the cluster where the source bucket resides.

    If you want to configure multiple cross-cluster replication rules for a source bucket, you must specify the same destination bucket for all the rules. Modifying the destination bucket of one rule will change the destination bucket of the other rules.

    Permissions

    IAM Agency

    Delegates the resource operation permissions to OBS, so that OBS uses this agency to perform the cross-cluster replication.

    If no IAM agency is available, refer to Creating an Agency for Cross-Region or Cross-Cluster Replication to create one. If you have already created IAM agencies, select one from the drop-down list.

    NOTE:

    Agency requirements:

    The IAM agency selected here must be of OBS and must have the OBS administrator permission (all OBS permissions).

  4. Click OK. The cross-cluster replication rule is created.