Apply suggestions from code review + local changes Co-authored-by: Poorna Krishnamoorthy <poornas@users.noreply.github.com> Co-authored-by: Krishnan Parthasarathi <krisis@users.noreply.github.com> Apply suggestions from code review Co-authored-by: Krishnan Parthasarathi <krisis@users.noreply.github.com>
6.6 KiB
Transition Objects from MinIO to GCS
minio
Table of Contents
The procedure on this page creates a new object lifecycle management rule that transition objects from a MinIO bucket to a remote storage tier on the Google Cloud Storage backend. This procedure supports use cases like moving aged data to low-cost public cloud storage solutions after a certain time period or calendar date.
Requirements
Install and Configure
mc
This procedure uses mc
for performing operations on the MinIO cluster.
Install mc
on a machine
with network access to both source and destination clusters. See the
mc
Installation Quickstart <mc-install>
for
instructions on downloading and installing mc
.
Use the mc alias
command to create an alias for the source MinIO cluster. Alias creation
requires specifying an access key for a user on the source and
destination clusters. The specified users must have permissions
<minio-lifecycle-management-transition-to-gcs-permissions>
for configuring and applying transition operations.
Required MinIO Permissions
MinIO requires the following permissions scoped to the bucket or buckets for which you are creating lifecycle management rules.
s3:PutBucketLifecycle
s3:GetBucketLifecycle
MinIO also requires the following administrative permissions on the cluster in which you are creating remote tiers for object transition lifecycle management rules:
admin:SetTier
admin:ListTier
For example, the following policy provides permission for configuring object transition lifecycle management rules on any bucket in the cluster:.
/extra/examples/LifecycleManagementAdmin.json
Required GCS Permissions
Object transition lifecycle management rules require additional
permissions on the remote storage tier. Specifically, MinIO requires the
GCS (Google Cloud Storage)
credentials provide read,
write, list, and delete permissions for the remote bucket.
Refer to the GCS IAM permissions documentation for more complete guidance on configuring the required permissions.
Considerations
Lifecycle Management Object Scanner
MinIO uses a scanner process to check objects against all configured
lifecycle management rules. Slow scanning due to high IO workloads or
limited system resources may delay application of lifecycle management
rules. See minio-lifecycle-management-scanner
for more
information.
Exclusive Bucket Access
MinIO retains the minimum object metadata required to support retrieving objects transitioned to a remote tier. MinIO therefore requires exclusive access to the data on the remote storage tier. Object retrieval assumes no external mutation, migration, or deletion of stored objects.
MinIO also ignores any objects in the remote bucket or bucket prefix not explicitly managed by MinIO.
Procedure
1) Configure User Accounts and Policies for Lifecycle Management
2) Configure the Remote Storage Tier
Use the mc admin tier add
command to add a new Google Cloud
Storage service as the remote storage tier:
mc admin tier add gcs TARGET TIER_NAME \
--endpoint https://HOSTNAME \
--bucket BUCKET \
--prefix PREFIX
--credentials-file CREDENTIALS \
--region REGION
The example above uses the following arguments:
Argument | Description |
---|---|
TARGET <mc admin tier add TARGET> |
The alias <mc alias> of the MinIO deployment on which
to configure the GCS (Google Cloud Storage) remote tier. |
TIER_NAME <mc admin tier add TIER_NAME> |
The name to associate with the new GCS (Google Cloud Storage) remote storage tier. This
value is required in the next step. |
HOSTNAME <mc admin tier add endpoint> |
The URL endpoint for the GCS (Google Cloud Storage) storage backend. |
BUCKET <mc admin tier add bucket> |
The name of the bucket on the GCS (Google Cloud Storage) storage backend to which
MinIO transitions objects. |
PREFIX <mc admin tier add prefix> |
The optional bucket prefix within which MinIO transitions objects. Omit this argument to transition objects to the bucket root. |
CREDENTIALS <mc admin tier add credentials-file> |
The credential
file for a user on the remote GCS tier. The specified user
credentials must correspond to a GCS user with the required
permissions
<minio-lifecycle-management-transition-to-gcs-permissions-remote> . |
REGION <mc admin tier add region> |
The GCS (Google Cloud Storage) region of the specified
BUCKET . You can safely omit this option if the
HOSTNAME includes the region. |
3) Create and Apply the Transition Rule
3) Verify the Transition Rule
Use the mc ilm list
command to review the configured
transition rules:
mc ilm list ALIAS/PATH --transition
- Replace
ALIAS <mc ilm list TARGET>
with thealias <mc alias>
of the MinIO deployment. - Replace
PATH <mc ilm list TARGET>
with the name of the bucket for which to retrieve the configured lifecycle management rules.