minio客户端mc命令

下载 mc

1
# wget https://dl.min.io/client/mc/release/linux-amd64/mc

安装客户端

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
 mc --version
mc version RELEASE.2024-01-13T08-44-48Z (commit-id=799ded568dc7a40547e417be460de37b985ab11a)
Runtime: go1.21.5 linux/amd64
Copyright (c) 2015-2024 MinIO, Inc.
License GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>

apps-gitlab  [🌱 master][ 🛤️ 11 ]
 🌈🌈🌈 mc config host add minio http://minio-api.local.choral.io
mc: Configuration written to `/home/xfhuang/.mc/config.json`. Please update your access credentials.
mc: Successfully created `/home/xfhuang/.mc/share`.
mc: Initialized share uploads `/home/xfhuang/.mc/share/uploads.json` file.
mc: Initialized share downloads `/home/xfhuang/.mc/share/downloads.json` file.
Enter Access Key: SBZDkwTwiNkcUxKVve9X
Enter Secret Key:
Added `minio` successfully.

配置访问 minio

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
 🌈🌈🌈 mc config host list
gcs
  URL       : https://storage.googleapis.com
  AccessKey : YOUR-ACCESS-KEY-HERE
  SecretKey : YOUR-SECRET-KEY-HERE
  API       : S3v2
  Path      : dns

local
  URL       : http://localhost:9000
  AccessKey :
  SecretKey :
  API       :
  Path      : auto

minio
  URL       : http://minio-api.local.choral.io
  AccessKey : admin
  SecretKey : minio1234
  API       : s3v4
  Path      : auto

play
  URL       : https://play.min.io
  AccessKey : Q3AM3UQ867SPQQA43P2F
  SecretKey : zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG
  API       : S3v4
  Path      : auto

s3
  URL       : https://s3.amazonaws.com
  AccessKey : YOUR-ACCESS-KEY-HERE
  SecretKey : YOUR-SECRET-KEY-HERE
  API       : S3v4
  Path      : dns

minio 常用命令:

a 显示 minio 的存储桶:

1
2
 🌈🌈🌈 mc ls minio
[2024-01-09 09:03:26 CST]     0B test/

b 创建桶

1
2
 🌈🌈🌈 mc mb minio/test1
Bucket created successfully `minio/test1`.

c 上传数据

1
2
 mc cp default.yaml minio/test1
...s/apps-gitlab/default.yaml: 696 B / 696 B ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 35.68 KiB/s 0s

d 下载数据

1
mc cp mini/test1/default.yaml .

参考文档:

http://docs.minio.org.cn/docs/master/minio-client-complete-guide

https://github.com/minio/mc

Licensed under CC BY-NC-SA 4.0
最后更新于 Jan 06, 2025 05:52 UTC
comments powered by Disqus
Built with Hugo
主题 StackJimmy 设计
Caret Up