mc mb
The mc mb
command creates a new bucket on a AIStor deployment.
You can also use mc mb
to create buckets on S3-compatible services.
Syntax
Parameters
ALIAS
Required
The AIStor or other S3-compatible service on which to create the new bucket.
For creating a bucket on AIStor, specify the alias and the name of the bucket. For example:
mc mb play/mybucket
For creating a directory on a local filesystem, specify the full path to that directory. For example:
mc mb ~/mydata/mydir
--ignore-existing, p
Optional
Directs mc mb
to do nothing if the bucket or directory already exists.
--region
Optional
The region in which to create the specified bucket.
Has no effect if the specified ALIAS
is a filesystem directory.
If not specified, default value is us-east-1
.
--with-lock, l
Optional
Enables object locking on the specified bucket. Object locking requires, and therefore implies, enabling object versioning.
--with-versioning
Optional
Enables object versioning on the new bucket. With versioning enabled, by default AIStor allows up to the maximum value of an Int64 versions per object, or over 9.2 quintillion. Define object expiration rules to remove versions of objects no longer needed, such as by the number of versions or the date of versions.
Versioning is required for bucket replication or site replication. Versioning does not imply or require object locking.
Global Flags
This command supports any of the global flags.
Examples
Create Bucket with Object Locking
Use mc mb
to create a bucket on an S3-compatible host.
The --with-lock
option creates the bucket with locking enabled:
mc mb --with-lock ALIAS/BUCKET
Create a New Bucket in a Specific Region
Use mc mb
to create a bucket on an S3-compatible host.
The --region
option creates the bucket in a desired region.
mc mb --region --region=us-west-2 myminio/mynewbucket
The above command creates a new bucket, mynewbucket
on the myminio
bucket within the us-west-2
region.
Create a New Bucket with Versioning Enabled
mc mb --with-versioning myminio/myversionedbucket
The above command creates a new bucket, myversionedbucket
, on the myminio
alias.
The new bucket enables object versioning for all objects in the bucket.
Behavior
Bucket Limits Per Deployment
AIStor does not limit the number of buckets you can create on a deployment. However, AIStor recommends no more than 500,000 buckets per deployment as a general guideline.
Bucket Limits for Non-AIStor S3 Services
Certain S3 services may restrict the number of buckets a given user or account can create.
For example, Amazon S3 limits each account to 100 buckets.
mc mb
may return an error if the user has reached bucket limits on the target S3 service.
AIStor Object Storage deployments do not place any limits on the number of buckets each user can create.
Enable Object Locking at Bucket Creation
AIStor follows AWS S3 behavior where you must enable object locking at bucket creation. Buckets created without object locking can never enable object retention or locking.
Enabling bucket locking does not set any object locking or retention settings. Consider enabling bucket locking as standard practice.
S3 Compatibility
The mc
commandline tool is built for compatibility with the AWS S3 API and is tested with AIStor and AWS S3 for expected functionality and behavior.
AIStor provides no guarantees for other S3-compatible services, As their S3 API implementation is unknown and therefore unsupported.
While mc
commands may work as documented, any such usage is at your own risk.