Minio简介
Minio 是一个基于Apache License v2.0开源协议的对象存储服务。它兼容亚马逊S3云存储服务接口,非常适合于存储大容量非结构化的数据,例如图片、视频、日志文件、备份数据和容器/虚拟机镜像等,而一个对象文件可以是任意大小,从几kb到最大5T不等。
Minio是一个非常轻量的服务,可以很简单的和其他应用的结合,类似 NodeJS, Redis 或者 MySQL。
Minio不仅提供了服务器、Web访问、客户端,还提供了Docker安装,各种语言的SDK、实例、实战秘籍等等,支持分布式部署,官方文档一应俱全。
Minio安装
MacOS
yangjun@192 ~ % brew install minio/stable/minio
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/cask and homebrew/services).
==> New Casks
8x8-work dropzone odbc-manager wezterm
diagnostics guilded pktriot
disk-expert hush ubports-installer
==> Updated Casks
Updated 571 casks.
==> Deleted Casks
adafruit-arduino blue-jeans-browser-plugin
adobe-lens-profile-creator caramba-switcher
beautune pdftotext
==> Tapping minio/stable
Cloning into '/usr/local/Homebrew/Library/Taps/minio/homebrew-stable'...
remote: Enumerating objects: 1269, done.
remote: Counting objects: 100% (133/133), done.
remote: Compressing objects: 100% (91/91), done.
remote: Total 1269 (delta 86), reused 89 (delta 42), pack-reused 1136
Receiving objects: 100% (1269/1269), 167.67 KiB | 981.00 KiB/s, done.
Resolving deltas: 100% (831/831), done.
Tapped 2 formulae (16 files, 222.7KB).
==> Installing minio from minio/stable
==> Downloading https://dl.minio.io/server/minio/release/darwin-amd64/archive/mi
######################################################################## 100.0%
==> Download complete!
==> Useful links:
Command-line Access: https://docs.min.io/docs/minio-client-quickstart-guide
Object API (Amazon S3 compatible):
Go: https://docs.min.io/docs/golang-client-quickstart-guide
Java: https://docs.min.io/docs/java-client-quickstart-guide
Python: https://docs.min.io/docs/python-client-quickstart-guide
JavaScript: https://docs.min.io/docs/javascript-client-quickstart-guide
.NET: https://docs.min.io/docs/dotnet-client-quickstart-guide
Talk to the community: https://slack.min.io
==> Get started:
NAME:
minio server - start object storage server
USAGE:
minio server [FLAGS] DIR1 [DIR2..]
minio server [FLAGS] DIR{1...64}
minio server [FLAGS] DIR{1...64} DIR{65...128}
DIR:
DIR points to a directory on a filesystem. When you want to combine
multiple drives into a single large system, pass one directory per
filesystem separated by space. You may also use a '...' convention
to abbreviate the directory arguments. Remote directories in a
distributed setup are encoded as HTTP(s) URIs.
FLAGS:
--address value bind to a specific ADDRESS:PORT, ADDRESS can be an IP or hostname (default: ":9000")
--console-address value bind to a specific ADDRESS:PORT for embedded Console UI, ADDRESS can be an IP or hostname
--certs-dir value, -S value path to certs directory (default: "/Users/yangjun/.minio/certs")
--quiet disable startup information
--anonymous hide sensitive information from logging
--json output server logs and startup information in json format
--help, -h show help
EXAMPLES:
1. Start minio server on "/home/shared" directory.
$ minio server /home/shared
2. Start single node server with 64 local drives "/mnt/data1" to "/mnt/data64".
$ minio server /mnt/data{1...64}
3. Start distributed minio server on an 32 node setup with 32 drives each, run following command on all the nodes
$ export MINIO_ROOT_USER=minio
$ export MINIO_ROOT_PASSWORD=miniostorage
$ minio server http://node{1...32}.example.com/mnt/export{1...32}
4. Start distributed minio server in an expanded setup, run the following command on all the nodes
$ export MINIO_ROOT_USER=minio
$ export MINIO_ROOT_PASSWORD=miniostorage
$ minio server http://node{1...16}.example.com/mnt/export{1...32} \
http://node{17...64}.example.com/mnt/export{1...64}
🍺 /usr/local/Cellar/minio/RELEASE.2021-07-27T02-40-15Z_1: 3 files, 95.8MB, built in 10 seconds
yangjun@192 ~ %
启动minio
yangjun@192 ~ % minio server /Users/yangjun/Desktop/minio
API: http://100.100.141.244:9000 http://127.0.0.1:9000
RootUser: minioadmin
RootPass: minioadmin
Console: http://100.100.141.244:56691 http://127.0.0.1:56691
RootUser: minioadmin
RootPass: minioadmin
Command-line: https://docs.min.io/docs/minio-client-quickstart-guide
$ mc alias set myminio http://100.100.141.244:9000 minioadmin minioadmin
Documentation: https://docs.min.io
WARNING: Console endpoint is listening on a dynamic port (56691), please use --console-address ":PORT" to choose a static port.
WARNING: Detected default credentials 'minioadmin:minioadmin', we recommend that you change these values with 'MINIO_ROOT_USER' and 'MINIO_ROOT_PASSWORD' environment variables
启动有两个警告,一个是需要改密码,一个是需要指定固定端口
minio server --console-address '0.0.0.0:9999' /Users/yangjun/Desktop/minio
Minio Web
安装后运行启动命令,启动成功后使用浏览器访问http://127.0.0.1:9000,如果可以访问,则表示Minio已安装成功。
Minio Server
Minio server在默认情况下会将所有配置信息存到 ${HOME}/.minio/config.json
文件中。 以下部分提供每个字段的详细说明以及如何自定义它们。一个完整的 config.json
在 这里
配置目录
默认的配置目录是 ${HOME}/.minio
,你可以使用--config-dir
命令行选项重写之。 Minio server在首次启动时会生成一个新的config.json
,里面带有自动生成的访问凭据。
minio server --config-dir /etc/minio /data
配置参数详见官方文档,Minio Server Config Guide
Minio 客户端
Minio客户端,Minio Client (mc)为ls,cat,cp,mirror,diff,find等UNIX命令提供了一种替代方案。它支持文件系统和兼容Amazon S3的云存储服务(AWS Signature v2和v4)。详见官方文档,Minio Client Quickstart Guide
Spring boot 集成
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
<version>3.0.10</version>
</dependency>
网友评论