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.
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 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 for configuring and
applying transition operations.
MinIO requires the following permissions scoped to the bucket or buckets for which you are creating lifecycle management rules.
MinIO also requires the following administrative permissions on the cluster in which you are creating remote tiers for object transition lifecycle management rules:
For example, the following policy provides permission for configuring object transition lifecycle management rules on any bucket in the cluster:.
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"admin:SetTier",
"admin:ListTier"
],
"Effect": "Allow",
"Sid": "EnableRemoteTierManagement"
},
{
"Action": [
"s3:PutLifecycleConfiguration",
"s3:GetLifecycleConfiguration"
],
"Resource": [
"arn:aws:s3:::*"
],
"Effect": "Allow",
"Sid": "EnableLifecycleManagementRules"
}
]
}
Object transition lifecycle management rules require additional permissions on the remote storage tier. Specifically, MinIO requires the GCS 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.
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 Lifecycle Management Object Scanner for more information.
MinIO requires exclusive access to the transitioned data on the remote storage tier. MinIO ignores any objects in the remote bucket or bucket prefix not explicitly managed by the MinIO deployment. Automatic transition and transparent object retrieval depend on the following assumptions:
No external mutation, migration, or deletion of objects on the remote storage.
No lifecycle management rules (e.g. transition or expiration) on the remote storage bucket.
MinIO stores all transitioned objects in the remote storage bucket or resource under a unique per-deployment prefix value. This value is not intended to support identifying the source deployment from the backend. MinIO supports an additional optional human-readable prefix when configuring the remote target, which may facilitate operations related to diagnostics, maintenance, or disaster recovery.
MinIO recommends specifying this optional prefix for remote storage tiers which contain other data, including transitioned objects from other MinIO deployments. This tutorial includes the necessary syntax for setting this prefix.
MinIO creates metadata for each transitioned object that identifies its location on the remote storage. This metadata is required for accessing the object, such that applications cannot access a transition object independent of MinIO. Availability of the transitioned data therefore depends on the same core protections that erasure coding and distributed deployment topologies provide for all objects on the MinIO deployment. Using object transition does not provide any additional business continuity or disaster recovery benefits.
Workloads that require BC/DR protections should implement MinIO Server-Side replication. Replication ensures objects remains preserved on the remote replication site, such that you can resynchronize from the remote in the event of partial or total data loss. See Resynchronization (Disaster Recovery) for more complete documentation on using replication to recover after partial or total data loss.
This step creates users and policies on the MinIO deployment for supporting lifecycle management operations. You can skip this step if the deployment already has users with the necessary permissions.
The following example uses Alpha
as a placeholder alias
for
the MinIO deployment. Replace this value with the appropriate alias for the
MinIO deployment on which you are configuring lifecycle management rules.
Replace the password LongRandomSecretKey
with a long, random, and secure
secret key as per your organizations best practices for password generation.
wget -O - https://docs.min.io/minio/baremetal/examples/LifecycleManagementAdmin.json | \
mc admin policy add Alpha LifecycleAdminPolicy /dev/stdin
mc admin user add Alpha alphaLifecycleAdmin LongRandomSecretKey
mc admin policy set Alpha LifecycleAdminPolicy user=alphaLifecycleAdmin
This example assumes that the specified aliases have the necessary permissions for creating policies and users on the deployment. See User Management and MinIO Policy Based Access Control for more complete documentation on MinIO users and policies respectively.
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 |
---|---|
The |
|
The name to associate with the new GCS
remote storage tier. Specify the name in all-caps, e.g. |
|
The URL endpoint for the GCS storage backend. |
|
The name of the bucket on the GCS storage backend to which MinIO transitions objects. |
|
The optional bucket prefix within which MinIO transitions objects. MinIO stores all transitioned objects in the specified MinIO recommends specifying this optional prefix for remote storage tiers which contain other data, including transitioned objects from other MinIO deployments. This prefix should provide a clear reference back to the source MinIO deployment to faciliate ease of operations related to diagnostics, maintenance, or disaster recovery. |
|
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. |
|
The GCS region of the specified
|
Use the mc ilm add
command to create a new transition rule
for the bucket. The following example configures transition after the
specified number of calendar days:
mc ilm add ALIAS/BUCKET \
--storage-class TIERNAME \
--transition-days DAYS \
--noncurrentversion-transition-days NONCURRENT_DAYS
--noncurrentversion-transition-storage-class TIERNAME
The example above specifies the following arguments:
Argument |
Description |
---|---|
Specify the |
|
Specify the full path to the bucket for which you are creating the lifecycle management rule. |
|
The remote storage tier to which MinIO transitions objects. Specify the remote storage tier name created in the previous step. If you want to transition noncurrent object versions to a distinct
remote tier, specify a different tier name for
|
|
The number of calendar days after which MinIO marks an object as
eligible for transition. Specify the number of days as an integer,
e.g. |
|
The number of calendar days after which MinIO marks a noncurrent
object version as eligible for transition. MinIO specifically measures
the time since an object became non-current instead of the object
creation time. Specify the number of days as an integer,
e.g. Omit this value to ignore noncurrent object versions. This option has no effect on non-versioned buckets. |
Use the mc ilm ls
command to review the configured transition
rules:
mc ilm ls ALIAS/PATH --transition
This work is licensed under a Creative Commons Attribution 4.0 International License.
©2020-Present, MinIO, Inc.