Using obsutil to Replicate Data Across Regions on the Client Side
obsutil client supports cross-region replication. You can directly replicate data from a source bucket to the destination bucket through data streams. The source bucket and destination bucket can be any two OBS buckets. Objects can be replicated between buckets in different regions under the same account or across accounts. The following procedure describes how to replicated data between buckets across accounts and regions:
- Run the obsutil config command to configure the AK, SK, and endpoint of the source bucket account.
- In Windows
obsutil config -i=src_ak -k=src_sk -e=src_endpoint -crr
- In Linux
./obsutil config -i=src_ak -k=src_sk -e=src_endpoint -crr
- In Windows
- Run the obsutil config command to configure the AK, SK, and endpoint of the destination bucket account.
- In Windows
obsutil config -i=dst_ak -k=dst_sk -e=dst_endpoint
- In Linux
./obsutil config -i=dst_ak -k=dst_sk -e=dst_endpoint
- In Windows
- Run the cp command to specify that cross-region replication method is used to copy objects from the source bucket to the destination bucket.
- In Windows
obsutil cp obs://src-bucket obs://dst-bucket -f -r -crr
- In Linux
./obsutil cp obs://src-bucket obs://dst-bucket -f -r -crr
- In Windows
- To use the cross-region replication function, you need to specify the -crr parameter. If this parameter is specified, update the configuration of the client-side cross-region replication in the configuration file. For details, see Updating a Configuration File.
- The configurations of the source bucket and destination bucket are respectively akCrr/skCrr/tokenCrr/endpointCrr and ak/sk/token/endpoint in the configuration file.
- The preceding procedure is also applicable to the situation when the source and destination buckets belong to the same account.
When the -crr parameter is used, the source object's standard metadata, including Cache-Control, Expires, Content-Encoding, Content-Disposition, Content-Type, and Content-Language, will not be copied.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.