mc replicate add 子命令用来添加服务器端复制配置规则,语法如下:
C:\> mc replicate add -h NAME: mc replicate add - add a server side replication configuration rule USAGE: mc replicate add TARGET FLAGS: --config-dir value, -C value path to configuration folder (default: "C:\\Users\\Administrator\\mc") --quiet, -q disable progress bar display --no-color disable color theme --json enable JSON lines formatted output --debug enable debug output --insecure disable SSL certificate verification --arn value unique role ARN --id value id for the rule, should be a unique value --tags value format '<key1>=<value1>&<key2>=<value2>&<key3>=<value3>', multiple values allowed for multiple key/value pairs --storage-class value storage class for destination (STANDARD_IA,REDUCED_REDUNDANCY etc) --disable disable the rule --priority value priority of the rule, should be unique and is a required field (default: 0) --remote-bucket value remote bucket, should be a unique value for the configuration --replicate value comma separated list to enable replication of delete markers, deletion of versioned objects and replica metadata sync(in the case of active-active replication).Valid options are "delete-marker", "delete" ,"replica-metadata-sync", "existing-objects" and "" --help, -h show help
(1)在别名为 “myminio” 的 MinIO 存储服务的 “mybucket” 存储桶上为添加复制配置规则,将所有带有标签“key1=value1,key2=value2” 的对象复制到 destbucket,包括删除标记和版本化删除。
C:\> mc replicate add myminio/mybucket/prefix --tags "key1=value1&key2=value2" \ --storage-class "STANDARD" \ --arn 'arn:minio:replication::c5be6b16-769d-432a-9ef1-4567081f3566:destbucket' \ --priority 1 \ --remote-bucket "destbucket" --replicate "delete,delete-marker"
(2)在存储桶 “mybucket” 上为别名 “myminio” 添加具有禁用状态的复制配置规则。
C:\> mc replicate add myminio/mybucket/prefix --tags "key1=value1&key2=value2" \ --storage-class "STANDARD" --disable \ --arn 'arn:minio:replica::c5be6b16-769d-432a-9ef1-4567081f3566:destbucket' \ --priority 1 \ --remote-bucket "destbucket"
(3)添加具有现有对象复制的复制配置规则,删除标记复制和在存储桶 “mybucket” 上为别名 “myminio” 启用的版本化删除。
C:\> mc replicate add myminio/mybucket/prefix --tags "key1=value1&key2=value2" \ --storage-class "STANDARD" --disable \ --arn 'arn:minio:replica::c5be6b16-769d-432a-9ef1-4567081f3566:destbucket' \ --priority 1 \ --remote-bucket "destbucket" \ --replicate "existing-objects,delete,delete-marker"