Minio Client(mc)
Install
refer to : https://min.io/docs/minio/linux/reference/minio-mc.html
mkdir MinioClient
cd MinioClient
wget https://dl.min.io/client/mc/release/linux-amd64/mc
chmod u+x mc
vim /etc/profile
export PATH=$PATH:/opt/MinioClient
source /etc/profile
mc --help
[root@VM-8-13-opencloudos MinioClient]# mc --version
mc version RELEASE.2024-07-26T13-08-44Z (commit-id=8ad22bb69435c831b6a16d4cb03c248145929d95)
Runtime: go1.22.5 linux/amd64
Copyright (c) 2015-2024 MinIO, Inc.
License GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>
设置别名alias
mc alias set ALIAS HOSTNAME ACCESS_KEY SECRET_KEY
- Replace
ALIAS
with a name to associate to the S3 service.mc
commands typically requireALIAS
as an argument for identifying which S3 service to execute against. - Replace
HOSTNAME
with the URL endpoint or IP address of the S3 service. - Replace
ACCESS_KEY
andSECRET_KEY
with the access and secret keys for a user on the S3 service.
# 参考 mc alias set myminio https://minioserver.example.net ACCESS_KEY SECRET KEY
mc alias set myminio http://127.0.0.1:9000 weipeng weipeng@minio
# test the connection
mc admin info myminio
● 127.0.0.1:9000
Uptime: 2 months
Version: 2023-08-16T20:17:30Z
Network: 1/1 OK
Drives: 1/1 OK
Pool: 1
Pools:
1st, Erasure sets: 1, Drives per erasure set: 1
864 KiB Used, 1 Bucket, 5 Objects
1 drive online, 0 drives offline
# refer to : https://min.io/docs/minio/linux/reference/minio-mc/mc-alias-remove.html#command-mc.alias.remove
# The following command removes the myminio alias for a MinIO deployment from the host machine:
mc alias remove myminio
Download file
mc alias set hxhbminio http://218.94.128.34:9000 weipeng weipeng@minio
mc admin info hxhbminio
mc find hxhbminio/small-software-package/taosTools-2.4.11-Linux-x64-comp3.rpm
# 将taosTools-2.4.11-Linux-x64-comp3.rpm,下载到当前目录中
mc get hxhbminio/small-software-package/taosTools-2.4.11-Linux-x64-comp3.rpm ./
通过mc上传文件
refer to : https://min.io/docs/minio/linux/reference/minio-mc/mc-put.html
mc alias set hxhbminio http://218.94.128.34:9000 weipeng weipeng@minio
mc admin info hxhbminio
# 将/home/test下的iot2-server-manage.jar文件,上传到minio中的
mc put /home/test/iot2-server-manage.jar hxhbminio/tmp-package/xuyi/b83b8a50faabcc2aa07749f0260d2964.jar