1
0
mirror of https://github.com/minio/docs.git synced 2025-09-02 00:02:14 +03:00
Files
docs/source/reference/minio-mc/mc-replicate-update.rst
Daryl White 2f8c5a94f6 Release updates mc RELEASE.2022-11-07T23-47-39Z (#640)
Changes to the docs related to mc
[RELEASE.2022-11-07T23-47-39Z](https://github.com/minio/mc/releases/tag/RELEASE.2022-11-07T23-47-39Z)

- Replaces `mc replicate edit` with `mc replicate update`
- Adds `mc admin idp oidc | ldap` commands
- Update to `mc support inspect` format
- Adds `mc admin rebalance` command
- Updates mc replicate edit references throughout docs to point to mc
replicate update.
- Adds a rebalance pools section to the expand deployment doc.
- Clarifies precedence for environment variables vs config settings.

Closes #636
Closes #632
2022-11-18 12:31:11 -06:00

11 KiB

mc replicate update

minio

Table of Contents

mc replicate edit

mc replicate update

RELEASE.2022-11-07T23-47-39Z

mc replicate update replaces the mc replicate edit command.

Syntax

The mc replicate update command modifies an existing bucket replication rule <minio-bucket-replication-serverside>.

mc [GLOBALFLAGS] replicate update FLAGS [FLAGS] ARGUMENTS [ARGUMENTS]

EXAMPLE

The following command modifies an existing replication rule for the mydata bucket on the myminio MinIO deployment:

mc replicate update --id "c76um9h4b0t1ijr36mug"           \
   --replicate "delete,delete-marker,existing-objects"  \
   myminio/mydata

The new replication configuration synchronizes all versioned delete operations, delete marker creation, and existing objects to the remote MinIO deployment.

SYNTAX

The command has the following syntax:

mc [GLOBALFLAGS] replicate update              \
                 --id "string"                 \
                 [--remote-bucket "string"]    \
                 [--disable]                   \
                 [--id "string"]               \
                 [--replicate "string"]        \
                 [--state "string"]            \
                 [--storage-class "string"]    \
                 [--tags "string"]             \
                 [--priority int]              \
                 ALIAS

Parameters

ALIAS

Required the alias <alias> of the MinIO deployment and full path to the bucket or bucket prefix on which to modify the replication rule. For example:

mc replicate update --id "c75nrap4b0talo3ipthg" [FLAGS]
--id

Specify the unique ID for a configured replication rule. Use the mc replicate ls command to list the replication rules for a bucket.

--priority

Specify the integer priority of the replication rule. The value must be unique among all other rules on the source bucket. Higher values imply a higher priority than all other rules.

--remote-bucket

Specify the ARN for the destination deployment and bucket. You can retrieve the ARN using mc admin bucket remote:

  • Use the mc admin bucket remote ls to retrieve a list of ARNs for the bucket on the destination deployment.
  • Use the mc admin bucket remote add to create a replication ARN

    for the bucket on the destination deployment.

--replicate

Specify a comma-separated list of the following values to enable extended replication features:

  • delete - Directs MinIO to replicate DELETE operations to the destination bucket.

  • delete-marker - Directs MinIO to replicate delete markers to the destination bucket.

  • replica-metadata-sync - Directs MinIO to synchronize metadata-only changes on a replicated object back to the source. This feature only effects two-way active-active <minio-bucket-replication-serverside-twoway> replication configurations.

    Omitting this value directs MinIO to stop replicating metadata-only changes back to the source.

  • existing-objects - Directs MinIO to replicate objects created prior to configuring or enabling replication. MinIO by default does not synchronize existing objects to the remote target.

    See minio-replication-behavior-existing-objects for more information.

--state

Enables or disables the replication rule. Specify one of the following values:

  • "enable" - Enables the replication rule.
  • "disable" - Disables the replication rule.

Objects created while replication is disabled are not immediately eligible for replication after enabling the rule. You must explicitly enable replication of existing objects by including "existing-objects" to the list of replication features specified to mc replicate update --replicate. See minio-replication-behavior-existing-objects for more information.

--storage-class

Specify the MinIO storage class <minio-ec-storage-class> to apply to replicated objects.

--tags

Specify one or more ampersand & separated key-value pair tags which MinIO uses for filtering objects to replicate. For example:

mc replicate update --id "ID" --tags "TAG1=VALUE&TAG2=VALUE&TAG3=VALUE"

MinIO applies the replication rule to any object whose tag set contains the specified replication tags.

Global Flags

Examples

Modify an Existing Replication Rule

Use mc replicate update to modify an existing replication rule.

mc replicate update ALIAS/PATH \
   --id ID                     \
   [--FLAGS]
  • Replace ALIAS <mc replicate update ALIAS> with the alias <mc alias> of the MinIO deployment.
  • Replace PATH <mc replicate update ALIAS> with the path to the bucket or bucket prefix on which the rule exists.
  • Replace ID <mc replicate update --id> with the unique identifier for the rule to modify. Use mc replicate ls to retrieve the list of replication rules on the bucket and their corresponding identifiers.

Note

Modifying a replication configuration rule does not effect already replicated objects. For example, modifying the ~mc replicate update --tags filter does not result in the removal of replicated objects which do not meet the filter.

Disable or Enable an Existing Replication Rule

Use mc replicate update with the ~mc replicate update --state flag to disable or enable a replication rule.

mc replicate update ALIAS/PATH \
   --id ID \
   --state "disabled"|"enabled"
  • Replace ALIAS <mc replicate update ALIAS> with the alias <mc alias> of the MinIO deployment.
  • Replace PATH <mc replicate update ALIAS> with the path to the bucket or bucket prefix on which the rule exists.
  • Replace ID <mc replicate update --id> with the unique identifier for the rule to modify. Use mc replicate ls to retrieve the list of replication rules on the bucket and their corresponding identifiers.
  • Specify either "disabled" or "enabled" to the ~mc replicate update --state flag to disable or enable the replication rule.

Note

MinIO requires enabling existing object replication <minio-replication-behavior-existing-objects> to synchronize objects written or removed after disabling a replication rule.

For rules without existing object replication, MinIO synchronizes only those write or delete operations issued while the replication rule is enabled.

Behavior

Required Permissions

MinIO strongly recommends creating users specifically for supporting bucket replication operations. See mc admin user and mc admin policy for more complete documentation on adding users and policies to a MinIO deployment.

Replication Admin

The following policy provides permissions for configuring and enabling replication on a deployment.

/extra/examples/ReplicationAdminPolicy.json

  • The "EnableRemoteBucketConfiguration" statement grants permission for creating a remote target for supporting replication.
  • The "EnableReplicationRuleConfiguration" statement grants permission for creating replication rules on a bucket. The "arn:aws:s3:::* resource applies the replication permissions to any bucket on the source deployment. You can restrict the user policy to specific buckets as-needed.

Use the mc admin policy add to add this policy to each deployment acting as a replication source. Use mc admin user add to create a user on the deployment and mc admin policy set to associate the policy to that new user.

Replication Remote User

The following policy provides permissions for enabling synchronization of replicated data into the deployment.

/extra/examples/ReplicationRemoteUserPolicy.json

  • The "EnableReplicationOnBucket" statement grants permission for a remote target to retrieve bucket-level configuration for supporting replication operations on all buckets in the MinIO deployment. To restrict the policy to specific buckets, specify those buckets as an element in the Resource array similar to "arn:aws:s3:::bucketName".
  • The "EnableReplicatingDataIntoBucket" statement grants permission for a remote target to synchronize data into any bucket in the MinIO deployment. To restrict the policy to specific buckets, specify those buckets as an element in the Resource array similar to "arn:aws:s3:::bucketName/*".

Use the mc admin policy add to add this policy to each deployment acting as a replication target. Use mc admin user add to create a user on the deployment and mc admin policy set to associate the policy to that new user.

S3 Compatibility