如何部署MinIO客户端?

MinIO

1 基础知识

– MinIO Client简称mc
– MinIO Client提供操作MinIO服务端的类UNIX命令(如ls、cat、cp、mirror、difffind等)
– MinIO Client支持文件系统和兼容Amazon S3的云存储服务(AWS Signature v2和V4)

2 最佳实践

2.1 部署MinIO服务端

2.1.1 准备MinIO

请根据文档准备MinIO存储环境,

如何部署分布式MinIO?

2.1.3 创建认证用户


如上图所示,
单击【Identity】->【Service Accounts】->【Create service account】
窗口显示如下,

2.2 部署MinIO客户端

2.2.1 下载客户端

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

2.2.2 部署客户端

mv mc /usr/local/bin/
chmod +x /usr/local/bin/mc

2.2.3 测试安装

mc -v

可见如下提示,

mc version RELEASE.2022-05-09T04-08-26Z

2.3 使用MinIO客户端

2.3.1 获取帮助

mc -h

可见如下提示,

NAME:
  mc - MinIO Client for cloud storage and filesystems.

USAGE:
  mc [FLAGS] COMMAND [COMMAND FLAGS | -h] [ARGUMENTS...]

COMMANDS:
  alias      manage server credentials in configuration file
  ls         list buckets and objects
  mb         make a bucket
  rb         remove a bucket
  cp         copy objects
  mv         move objects
  rm         remove object(s)
  mirror     synchronize object(s) to a remote site
  cat        display object contents
  head       display first 'n' lines of an object
  pipe       stream STDIN to an object
  find       search for objects
  sql        run sql queries on objects
  stat       show object metadata
  tree       list buckets and objects in a tree format
  du         summarize disk usage recursively
  retention  set retention for object(s)
  legalhold  manage legal hold for object(s)
  support    support related commands
  share      generate URL for temporary access to an object
  version    manage bucket versioning
  ilm        manage bucket lifecycle
  encrypt    manage bucket encryption config
  event      manage object notifications
  watch      listen for object notification events
  undo       undo PUT/DELETE operations
  anonymous  manage anonymous access to buckets and objects
  tag        manage tags for bucket and object(s)
  diff       list differences in object name, size, and date between two buckets
  replicate  configure server side bucket replication
  admin      manage MinIO servers
  update     update mc to latest release

GLOBAL FLAGS:
  --autocompletion              install auto-completion for your shell
  --config-dir value, -C value  path to configuration folder (default: "/root/.mc")
  --quiet, -q                   disable progress bar display
  --no-color                    disable color theme
  --json                        enable JSON lines formatted output
  --debug                       enable debug output
  --insecure                    disable SSL certificate verification
  --help, -h                    show help
  --version, -v                 print the version

TIP:
  Use 'mc --autocompletion' to enable shell autocompletion

VERSION:
  RELEASE.2022-05-09T04-08-26Z

2.3.2 设置MinIO存储别名

mc alias set minio https://minio.cmdschool.org:9000 XsWDGngxZEnlItCs mnHZ1tAkCPXN0kQaUFfWFm5RXS0fdXVM

以上用“minio”命名MinIO存储“https://minio.cmdschool.org”,成功后可见如下提示,

Added `minio` successfully.

然后,我们可以使用如下命令测试配置,

mc admin info minio

可见如下提示,

●  minio01.cmdschool.org:9000
   Uptime: 1 day
   Version: 2022-06-03T01:40:53Z
   Network: 4/4 OK
   Drives: 1/1 OK
   Pool: 1st

●  minio02.cmdschool.org:9000
   Uptime: 1 day
   Version: 2022-06-03T01:40:53Z
   Network: 4/4 OK
   Drives: 1/1 OK
   Pool: 1st

●  minio03.cmdschool.org:9000
   Uptime: 1 day
   Version: 2022-06-03T01:40:53Z
   Network: 4/4 OK
   Drives: 1/1 OK
   Pool: 1st

●  minio04.cmdschool.org:9000
   Uptime: 1 day
   Version: 2022-06-03T01:40:53Z
   Network: 4/4 OK
   Drives: 1/1 OK
   Pool: 1st

0 B Used, 1 Bucket, 0 Objects
4 drives online, 0 drives offline

2.4 常用的操作

创建桶和配置桶权限,

如何设置MinIO的桶和权限?

参阅文档
==============
https://docs.min.io/docs/minio-admin-complete-guide.html
https://docs.min.io/docs/minio-client-quickstart-guide.html

没有评论

发表回复

MinIO
如何使用MinFS挂载MinIO?

1 基础知识 1.1 MinFS的介绍 – MinFS是适用于Amazon S3兼容对象 …

MinIO
如何设置MinIO的桶和权限?

1 前言 一个问题,一篇文章,一出故事。 笔者需要学习创建MinIO存储的桶和权限,于是整理此文。 …

MinIO
如何部署分布式对象存储MinIO?

1 基础知识 1.1 纠删码 1.1.1 纠删码的介绍 – 纠删码是一种用于重建丢失或损 …