1
0
mirror of https://github.com/minio/docs.git synced 2025-05-21 11:53:41 +03:00
docs/source/administration/batch-framework.rst
Daryl White 363e688617
Updates for MinIO RELEASE.2023-04-07T05-28-58Z (#823)
- Adds new environment variable for ILM expiration workers
- Adds new metrics for locks
- Adds keyrotate batch job type
- Adds info about batch replicate from remote to local
    
Closes #806

Staged:
http://192.241.195.202:9000/staging/minio-2023-04-07/administration/batch-framework.html
2023-05-01 16:42:13 -05:00

5.3 KiB

Batch Framework

minio

Table of Contents

MinIO RELEASE.2022-10-08T20-11-00Z

The Batch Framework was introduced with the replicate job type in the mc RELEASES.2022-10-08T20-11-00Z.

Overview

The MinIO Batch Framework allows you to create, manage, monitor, and execute jobs using a YAML-formatted job definition file (a "batch file"). The batch jobs run directly on the MinIO deployment to take advantage of the server-side processing power without constraints of the local machine where you run the MinIO Client <minio-client>.

A batch file defines one job task.

Once started, MinIO starts processing the job. Time to completion depends on the resources available to the deployment.

If any portion of the job fails, MinIO retries the job up to the number of times defined in the job definition.

The MinIO Batch Framework supports the following job types:

Job Type Description
replicate Perform a one-time replication procedure from one MinIO location to another MinIO location.
keyrotate Perform a one-time process to cycle the sse-s3 or sse-kms <minio-sse-data-encryption> cryptographic keys on objects.

MinIO Batch CLI

  • Install the MinIO Client <minio-client>
  • Define an alias <mc alias set> for the MinIO deployment

The mc batch commands include

mc batch generate
mc batch start
mc batch list
mc batch status
mc batch describe

Access to mc batch

You can use MinIO's Policy Based Access Control <minio-policy> and the administrative policy actions <minio-policy-mc-admin-actions> to restrict who can start a batch job, retrieve a list of running jobs, or describe a running job.

Job Types

Replicate

Use the replicate job type to create a batch job that replicates objects from one MinIO deployment to another MinIO location. At least one of the deployment locations, either the source or the target, must be local. The definition file can limit the replication by bucket, prefix, and/or filters to only replicate certain objects.

MinIO RELEASE.2023-04-07T05-28-58Z

You can replicate from a remote MinIO deployment to the local deployment that runs the batch job.

For example, you can use a batch job to perform a one-time replication sync to push objects from a bucket on a local deployment at minio-local/invoices/ to a bucket on a remote deployment at minio-remote/invoices. You can also pull objects from the remote deployment at minio-remote/invoices to the local deployment at minio-local/invoices.

The advantages of Batch Replication over mc mirror include:

  • Removes the client to cluster network as a potential bottleneck
  • A user only needs access to starting a batch job with no other permissions, as the job runs entirely server side on the cluster
  • The job provides for retry attempts in event that objects do not replicate
  • Batch jobs are one-time, curated processes allowing for fine control replication

RELEASE.2023-02-17T17-52-43Z

Run batch replication with multiple workers in parallel by specifying the MINIO_BATCH_REPLICATION_WORKERS environment variable.

Sample YAML Description File for a replicate Job Type

Create a basic replicate job definition file you can edit with mc batch generate.

/includes/code/replicate.yaml

Key Rotate

MinIO RELEASE.2023-04-07T05-28-58Z

Use the keyrotate job type to create a batch job that cycles the sse-s3 or sse-kms keys <minio-sse-data-encryption> for encrypted objects.

The YAML configuration supports filters to restrict key rotation to a specific set of objects by creation date, tags, metadata, or kms key. You can also define retry attempts or set a notification endpoint and token.

Sample YAML Description File for a keyrotate Job Type

Create a basic keyrotate job definition file you can edit with mc batch generate.

/includes/code/replicate.yaml