MinIO客户端之alias
MinIO
提供了一个命令行程序mc
用于协助用户完成日常的维护、管理类工作。
官方资料
使用AK
/SK
创建一个新的别名,命令如下:
./mc alias set 'local' 'http://192.168.0.109:9000' 'U3mrTCIjBAzz57LxnEES' '80wLc0G26pWx7obWVoMwyh1QfjPUMI0PcL1R7KU3'
检查别名,执行如下命令:
./mc admin info local
控制台的输出,如下:
● 192.168.0.109:9000
Uptime: 45 minutes
Version: 2023-11-20T22:40:07Z
Network: 1/1 OK
Drives: 1/1 OK
Pool: 1
Pools:
1st, Erasure sets: 1, Drives per erasure set: 1
92 MiB Used, 1 Bucket, 1 Object
1 drive online, 0 drives offline
列举当前全部别名,命令如下:
./mc alias list
控制台的输出,如下:
gcs
URL : https://storage.googleapis.com
AccessKey : YOUR-ACCESS-KEY-HERE
SecretKey : YOUR-SECRET-KEY-HERE
API : S3v2
Path : dns
local
URL : http://192.168.0.109:9000
AccessKey : U3mrTCIjBAzz57LxnEES
SecretKey : 80wLc0G26pWx7obWVoMwyh1QfjPUMI0PcL1R7KU3
API : s3v4
Path : auto
myminio
URL : http://192.168.0.109:9000
AccessKey : admin
SecretKey : admin1234
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
列举指定的别名,命令如下:
./mc alias list local
控制台的输出,如下:
local
URL : http://192.168.0.109:9000
AccessKey : U3mrTCIjBAzz57LxnEES
SecretKey : 80wLc0G26pWx7obWVoMwyh1QfjPUMI0PcL1R7KU3
API : s3v4
Path : auto
导出别名local
的相关信息,命令如下:
./mc alias export local > local.json
cat ./local.json
控制台的输出,如下:
{"url":"http://192.168.0.109:9000","accessKey":"U3mrTCIjBAzz57LxnEES","secretKey":"80wLc0G26pWx7obWVoMwyh1QfjPUMI0PcL1R7KU3","api":"s3v4","path":"auto"}
删除别名local
,命令如下:
./mc alias remove local
控制台的输出,如下:
Removed `local` successfully.
再次列举local
,命令如下:
./mc alias list local
控制台的输出,如下:
mc: <ERROR> No such alias `local` found. Use `mc alias set mycloud local ...` to add an alias. Use the alias for S3 operations.
使用名称local1
,导入刚才导出的另外的配置文件,命令如下:
./mc alias import local1 local.json
控制台的输出,如下:
Imported `local1` successfully.
列举local1
,命令如下:
./mc alias list local1
控制台的输出,如下:
local1
URL : http://192.168.0.109:9000
AccessKey : U3mrTCIjBAzz57LxnEES
SecretKey : 80wLc0G26pWx7obWVoMwyh1QfjPUMI0PcL1R7KU3
API : s3v4
Path : auto
本文来自博客园,作者:jackieathome,转载请注明原文链接:https://www.cnblogs.com/jackieathome/p/17902535.html