minio客户端安装及使用

minio客户端安装及使用

  1. 客户端下载

官方下载地址:

https://dl.minio.io/client/mc/release/dl.minio.io
选择合适的版本进行mc下载

2.上传mc客户端到linux服务器

修改可执行权限

    chmod +x mc ;

测试命令

    ./mc --help;

3.添加S3访问配置

配置格式

mc config host add <ALIAS><YOUR-S3-ENDPOINT><YOUR-ACCESS-KEY><YOUR-SECRET-KEY><API-SIGNATURE>

例如:

注意事项:如果用户名和密码中含有!(等特殊字符需要用转义字符\做转移

./mc config host add bpm https://test.com oU-Qq\(JbzA\!sLD8a9zYF Wxgi\(caMt9MH1@c9uN* S3v4

查看

./mc ls bpm

上传文件到s3

 mc  cp -r * bpm/demo

 mc cp dist/* bpm/uat/fe/ --recursive

4.配置环境变量

vim /etc/profile

#minio client
export PATH="$PATH:/usr/software"

让环境变量立即生效执行如下命令:

#source /etc/profile  

测试环境变量配置是否成功,任意路径下执行

mc --help

5.常用命令

ls List files and folders.
mb Make a bucket or folder.
cat Display contents of a file.
pipe Write contents of stdin to target.When no target is specified, it writes to stdout.
share Generate URL for sharing.
cp Copy one or more objects to a target.
mirror Mirror folders recursively from a single source to single destination.
diff Compute differences between two folders.
rm Remove file or bucket [WARNING:Usewith care].
events Manage bucket notification.
watch Watchfor events on object storage and filesystem.
policy Setpublic policy on bucket or prefix.
session Manage saved sessions of cp and mirror operations.
config Manage configuration file.
update Checkfor a new software update.
version Print version.

编辑于 2018-07-12