mc admin tier 命令配置远程支持的 S3 兼容服务以支持 MinIO 生命周期管理,语法如下:
C:\>mc admin tier -h NAME: mc admin tier - configure remote tier targets for ILM transition USAGE: mc admin tier COMMAND [COMMAND FLAGS | -h] [ARGUMENTS...] COMMANDS: add add a new remote tier target ls lists remote tier targets edit edits a remote tier 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 --help, -h show help
添加新的远程 tier 目标,语法如下:
C:\>mc admin tier add -h NAME: mc admin tier add - add a new remote tier target USAGE: mc admin tier add TIER_TYPE TARGET NAME [TIER_FLAGS] NAME: Name of remote tier target. e.g WARM-TIER TIER_TYPE: Cloud storage backend where objects specified by bucket lifecycle configuration can be transitioned to. Supported values are s3, azure and gcs. TIER_FLAGS: Tier type specific flags. 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 --endpoint value remote tier endpoint. e.g https://s3.amazonaws.com --region value remote tier region. e.g us-west-2 --access-key value AWS S3 or compatible object storage access-key --secret-key value AWS S3 or compatible object storage secret-key --use-aws-role use AWS S3 role --account-name value Azure Blob Storage account name --account-key value Azure Blob Storage account key --credentials-file value path to Google Cloud Storage credentials file --bucket value remote tier bucket --prefix value remote tier prefix --storage-class value remote tier storage-class --help, -h show help
(1)配置一个新的远程 tier,将对象转换到 Azure Blob 存储中的存储桶。
C:\> mc admin tier add azure myminio AZTIER --account-name foobar --account-key foobar123 --region us-east-1 --bucket testbucket --prefix testprefix/
(2)配置一个新的远程 tier,将对象转换到 AWS S3 中具有 STANDARD 存储类的存储桶。
C:\> mc admin tier add s3 myminio S3TIER --endpoint https://s3.amazonaws.com --access-key foobar \ --secret-key foobar123 --region us-east-1 --bucket testbucket --prefix testprefix/ --storage-class "STANDARD"
(3)配置一个新的远程 tier,将对象转换为 Google Cloud Storage 中的存储桶。
C:\> mc admin tier add s3 myminio GCSTIER --credentials-file /path/to/credentials.json --region us-east-1 --bucket testbucket --prefix testprefix/
(4)配置一个新的远程 tier,使用 aws 角色将对象转换到 AWS S3 中具有 STANDARD 存储类的存储桶。
C:\> mc admin tier add s3 myminio S3TIER --endpoint https://s3.amazonaws.com --use-aws-role \ --region us-east-1 --bucket testbucket --prefix testprefix/ --storage-class "STANDARD"
列出远程 tier 目标,语法如下:
C:\>mc admin tier ls -h NAME: mc admin tier ls - lists remote tier targets USAGE: mc admin tier ls 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 --help, -h show help
(1)列出 myminio 中配置的远程 tier 目标
C:\> mc admin tier ls myminio
编辑远程 tier,语法如下:
C:\>mc admin tier edit -h NAME: mc admin tier edit - edits a remote tier USAGE: mc admin tier edit TARGET NAME NAME: Name of remote tier. e.g WARM-TIER FLAGS: --access-key value AWS S3 or compatible object storage access-key --secret-key value AWS S3 or compatible object storage secret-key --use-aws-role use AWS S3 role --account-name value Azure Blob Storage account name --account-key value Azure Blob Storage account key --credentials-file value path to Google Cloud Storage credentials file --help, -h show help
(1)更新现有 Azure Blob 存储远程 tier 的凭据。
C:\> mc admin tier edit myminio AZTIER --account-name foobar-new --account-key foobar-new123
(2)更新现有 AWS S3 兼容远程 tier 的凭证。
C:\> mc admin tier edit myminio S3TIER --access-key foobar-new --secret-key foobar-new123
(3)更新现有 Google Cloud Storage 远程 tier 的凭据。
C:\> mc admin tier edit myminio GCSTIER --credentials-file /path/to/credentials.json