AIStor Client
The AIStor Client (mc
) is a drop-in replacement for the Open Source MinIO Client.
AIStor mc
has exclusive functionality intended to support licensed AIStor Server deployments.
mc
has the following syntax:
mc [GLOBALFLAGS] COMMAND --help
See Command Quick Reference for a list of supported commands.
Version Alignment with AIStor Server
The AIStor Client releases separately from AIStor Server.
For best functionality and compatibility, use an client version released closest to the calendar date of your server release.
You can download the latest AIStor MinIO Client for your operating system from https://dl.min.io/aistor/mc/release/.
Quickstart
-
Install
mc
Install the
mc
command line tool onto the host machine. Click the tab that corresponds to the host machine operating system or environment: -
Create an Alias for the S3-Compatible Service
Run the
mc alias set
command to add the hostname of your AIStor Server deployment. Each of the following tabs contains a provider-specific example: -
Test the Connection
Run the
mc admin info
command to test the connection to the newly added server:mc admin info myminio
The command returns information on the S3 service if successful. If unsuccessful, check each of the following:
- The host machine has connectivity to the S3 service URL (i.e. using
ping
ortraceroute
). - The specified
ACCESSKEY
andSECRETKEY
correspond to a user on the S3 service. The user must have permission to perform actions on the service.
For AIStor servers, see Access Management for more information on user access permissions. For other S3-compatible services, defer to the documentation for that service.
- The host machine has connectivity to the S3 service URL (i.e. using
Command Quick Reference
The following table lists all top-level mc
commands (excluding mc admin
):
Command | Description |
---|---|
mc alias | Supports connecting to and running operations against S3-compatible hosts. |
mc anonymous | Supports setting or removing anonymous policies on a bucket and its contents. Allows public access where clients can perform any action granted by the policy without authentication. |
mc batch | Runs one or more job tasks on an AIStor deployment. |
mc cat | Concatenates the contents of a file or object to another file or object, or displays the contents to STDOUT . |
mc cp | Copies objects to or from an AIStor deployment, where the source can be AIStor or a local filesystem. |
mc diff | Computes the differences between two filesystem directories or AIStor buckets. Lists only objects which are missing or differ in size; does not compare contents. |
mc du | Summarizes the disk usage of buckets and folders. Can also be used against the local filesystem. |
mc encrypt | Sets, updates, or disables the default bucket Server-Side Encryption (SSE) mode. |
mc event | Adds, removes, or lists bucket event notifications. |
mc find | Searches for objects on an AIStor deployment or files on a filesystem. |
mc get | Downloads an object from a target S3 deployment to the local file system. |
mc head | Displays the first n lines of an object, where n is specified as an argument. |
mc idp ldap | Manages configurations for third-party Active Directory or LDAP Identity and Access Management (IAM) integrations. |
mc idp openid | Manages configurations for third-party OpenID Identity and Access Management (IAM) integrations. |
mc idp ldap policy | Shows the mapping relationships between policies and the associated groups or users. |
mc ilm rule | Manages object lifecycle management rules on an AIStor deployment. |
mc ilm tier | Manages tiering on an AIStor deployment. |
mc legalhold | Sets, removes, or retrieves the object legal hold (WORM) settings for objects. |
mc license | Works with cluster registration for AIStor SUBNET. Registers a deployment, displays license information, or updates the license key. |
mc ls | Lists buckets and objects on AIStor or another S3-compatible service. |
mc mb | Creates a new bucket or directory at the specified path. |
mc mirror | Synchronizes content to an AIStor deployment, similar to the rsync utility. Supports filesystems, AIStor deployments, and other S3-compatible hosts as the source. |
mc mv | Moves an object from source to target, such as between AIStor deployments or between buckets on the same deployment. Also supports moving objects between a local filesystem and AIStor. |
mc od | Copies a local file to a remote location in a specified number of parts and part sizes. Outputs the time taken to upload the file. |
mc ping | Performs a liveness check on a specified target. |
mc pipe | Streams content from STDIN to a target object. |
mc put | Uploads an object from the local file system to a bucket on a target S3 deployment. |
mc rb | Removes one or more buckets on AIStor or another S3-compatible service. To remove only the contents of a bucket, use mc rm instead. |
mc ready | Checks the status of a cluster and whether the cluster has read and write quorum. |
mc replicate | Configures and manages Server-Side Bucket Replication for an AIStor deployment, including active-active replication configurations and resynchronization. |
mc retention | Configures the Write-Once Read-Many (WORM) locking settings for objects in a bucket. Can also set the default object lock settings for a bucket. |
mc rm | Removes objects from a bucket on an AIStor deployment. To completely remove a bucket, use mc rb instead. |
mc share | Manages presigned URLs for downloading and uploading objects to an AIStor bucket. |
mc sql | Provides an S3 Select interface for performing SQL queries on objects in the specified AIStor deployment. |
mc stat | Displays information on objects in an AIStor bucket, including object metadata. Can also retrieve bucket metadata. |
mc support | Provides tools for analyzing deployment health or performance and for running diagnostics. Can also upload generated health reports for further analysis by AIStor engineering. |
mc tag | Adds, removes, and lists tags associated with a bucket or object. |
mc tree | Lists all prefixes inside an AIStor bucket in a tree format. Optionally lists all objects inside a bucket at each prefix, including the bucket root. |
mc undo | Reverses changes due to either a PUT or DELETE operation at a specified path. |
mc update | Updates the mc binary to the latest stable version. |
mc version | Enables, disables, and retrieves the versioning status for an AIStor bucket. |
mc watch | Watches for events on the specified AIStor bucket or local filesystem path. For S3 services, use mc event add to configure bucket event notifications on S3-compatible services. |
Configuration File
mc
uses a JSON
formatted configuration file used for storing certain kinds of information, such as the aliases
for each configured S3-compatible service.
For Linux and macOS, the default configuration file location is ~/.mc/config.json
.
For Windows, mc
attempts to construct a default file path by trying specific environment variables.
If a variable is unset, mc
moves to the next variable.
If all attempts fail, mc
returns an error.
The following list describes each possible file path location in the order mc
checks them:
HOME\.mc\config.json
USERPROFILE\.mc\config.json
HOMEDRIVE+HOMEPATH\.mc\config.json
You can use the --config-dir
flag to specify the location of the config.json
file.
Certificates
The AIStor client stores certificates and Certificate Authorities (CAs) for deployments to the following paths:
Linux, macOS, and other Unix-like systems:
~/.mc/certs/ # certificates
~/.mc/certs/CAs/ # Certificate Authorities
Windows systems:
C:\Users\[username]\mc\certs\ # certificates
C:\Users\[username]\mc\certs\CAs\ # Certificate Authorities
When creating a new alias, the AIStor client fetches the peer certificate, computes the public key fingerprint, and asks the user whether to accept the deployment’s certificate. If you decide to trust the certificate, the AIStor client adds the certificate to the certificate authority path listed above.
--insecure
flag.
Pattern Matching
Some commands and flags allow for pattern matching. When enabled, a pattern can include either of these wildcards for character replacement:
*
to represent a string of characters to match, either in the middle or end.?
to represent a single character.
For example, refer to the following for wildcard uses and their results.
Pattern | Text | Match Result |
---|---|---|
abc* |
ab | Match |
abc* |
abd | Not a match |
abc*c |
abcd | Match |
ab*??d |
abxxc | Match |
ab*??d |
abxc | Match |
ab??d |
abxc | Match |
ab??d |
abc | Match |
ab??d |
abcxdd | Not a match |
Global Options
All commands support the following global options. You can also define some of these options using Environment Variables.
--config-dir
The path to a JSON
formatted configuration file that mc
uses for storing data.
See Configuration File for more information on how mc
uses the configuration file.
Alternatively, set the environment variable MC_CONFIG_DIR
.
--custom-header
Alias -H
Add an additional custom HTTP header to the request in key:value
format.
--debug
Enables verbose output to the console.
For example, the following operation adds verbose output to the mc ls
command:
mc --debug ls play
Alternatively, set the environment variable MC_DEBUG
.
--disable-pager
Alias --dp
Disable the pager functionality of the AIStor client in the CLI.
When used, output prints to raw STDOUT
instead.
--insecure
Disables TLS/SSL certificate verification. Allows TLS connectivity to servers with invalid certificates. Exercise caution when using this option against untrusted S3 hosts.
Alternatively, set the environment variable MC_INSECURE
.
--json
Enables JSON lines formatted output to the console.
For example, the following operation adds JSON Lines output to the mc ls
command:
mc --json ls play
Alternatively, set the environment variable MC_JSON
.
--no-color
Disables the built-in color theme for console output. Useful for dumb terminals.
Alternatively, set the environment variable MC_NO_COLOR
.
--quiet
Suppresses console output.
Alternatively, set the environment variable MC_QUIET
.
--resolve
Creates a custom DNS mapping to resolve a HOST to a specified IP address.
Use the following syntax:
--resolve HOST[:PORT]=IP
For example:
mc alias set --resolve myminio.example.com:9000=192.168.188.118 'myminio' 'https://myminio.example.com:9000' 'miniouser' 'miniosecret'
Repeat the flag multiple times to add additional custom DNS mappings.
--version
Displays the current version of mc
.
--help
Optional
Displays a summary of command usage on the terminal.