MinIO 客户端的 mc mb 命令用来创建存储桶。语法如下:
C:\> mc mb -h NAME: mc mb - make a bucket USAGE: mc mb [FLAGS] TARGET [TARGET...] FLAGS: --region value specify bucket region; defaults to 'us-east-1' (default: "us-east-1") --ignore-existing, -p ignore if bucket/directory already exists --with-lock, -l enable object lock --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)在本地 MinIO 存储服务中创建一个存储桶。
D:\server\minio>mc mb local/files Bucket created successfully `local/files`.
(2)在 Google Cloud Storage 上创建一个新存储分区。
D:\server\minio>mc mb gcs/miniocloud Bucket created successfully `gcs/miniocloud`.
(3)在 Amazon S3 云存储上的“us-west-2”区域创建一个新存储桶。
D:\server\minio> mc mb --region=us-west-2 s3/myregionbucket
(4)创建一个新目录,包括其缺失的父目录(相当于'mkdir -p')。
D:\server\minio>mc mb /tmp/this/new/dir1
(5)创建多个目录,包括其缺失的父目录(行为类似于“mkdir -p”)。
D:\server\minio>mc mb /mnt/sdb/mydisk /mnt/sdc/mydisk /mnt/sdd/mydisk
(6)如果存储桶/目录已存在,则忽略。
D:\server\minio>mc mb --ignore-existing local/files Bucket created successfully `local/files`.
(7)在 Amazon S3 云存储上启用对象锁定的“us-west-2”区域中创建一个新存储桶。
D:\server\minio>mc mb --with-lock --region=us-west-2 s3/myregionbucket