MinIO 是一款轻量级、高性能、分布式的开源对象存储系统,可以100%的运行在标准硬件,即X86等低成本机器也能够很好的运行MinIO。国内的阿里巴巴、腾讯、百度、中国联通、华为、中国移动等9000多家企业也都有使用MinIO产品。
MinIO 官网网址:MinIO | 高性能,对Kubernetes友好的对象存储,提供了该产品的说明、技术方案、资源下载等。(如果需要自行编译也可以去开源网站下载源码,如https://github.com/minio/minio或https://gitee.com/mirrors/minio),MinIO提供了NET、go、java、javaScript、python、Haskell等SDK.
先在MinIO官网下载可直接部署的服务包minio.exe及客户端工具mc.exe:MinIO下载。
另外在win下将minio.exe服务化、后台化,需要用到nssm.exe工具,可前往NSSM - the Non-Sucking Service Manager下载合适的版本。
将下载好minio.exe、mc.exe、nssm.exe文件放置一个目录内,例如本文是D:\tools\minio,的创建两个脚本文件install.bat、uninstall.bat。
install.bat,将安装minio.exe并转成后台服务,指定存储目录为D:\minio_save,可以手动新建该存储目录
- cd D:\tools\minio
- nssm.exe install MinioSrv D:\tools\minio\minio.exe --certs-dir "D:\minio_save\.minio.sys\certs" server "D:\minio_save"
uninstall.bat,卸载服务
- cd D:\tools\minio
- nssm.exe remove MinioSrv confirm
配置好后,运行install.bat,服务正常启动。
安装后使用浏览器访问,http://ip:9000,如果可以访问,则表示 minio 已经安装成功。
默认的用户名集密码是: minioadmin, minioadmin
新建一个存储Buckets,并上传数据
本文创建了一个test的Buckets,点击浏览进入,上传一个压缩包
观察服务配置的存储目录看效果,顺利上传了压缩文件
mc.exe命令工具,可用-help先查看有那些命令,也可以去官网帮助文档页面(MinIO Admin Client,客户端管理)https://min.io/docs/minio/linux/reference/minio-mc.html,进行具体指令查看
- D:\tools\minio>mc.exe -help
- ────────────────────────────────────────────────────────────
- NAME:
- mc - MinIO Client for object 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
- license license related commands
- share generate URL for temporary access to an object
- ────────────────────────────────────────────────────────────
-
- D:\tools\minio>mc.exe admin
- ────────────────────────────────────────────────────────────
- NAME:
- mc admin - manage MinIO servers
-
- USAGE:
- mc admin COMMAND [COMMAND FLAGS | -h] [ARGUMENTS...]
-
- COMMANDS:
- service restart, stop and unfreeze a MinIO cluster
- update update all MinIO servers
- info display MinIO server information
- user manage users
- group manage groups
- policy manage policies defined in the MinIO server
- replicate manage MinIO site replication
- idp manage MinIO IDentity Provider server configuration
- config manage MinIO server configuration
- decommission, decom manage MinIO server pool decommissioning
- heal heal bucket(s) and object(s) on MinIO server
- prometheus manages prometheus config
- kms perform KMS management operations
- bucket manage buckets defined in the MinIO server
- tier manage remote tier targets for ILM transition
- scanner provide MinIO scanner info
- top provide top like statistics for MinIO
- trace show http trace for MinIO server
- cluster manage MinIO cluster metadata
-
- FLAGS:
- ────────────────────────────────────────────────────────────
mc.exe命令工具使用测试,远程管理示例
- D:\tools\minio>mc.exe config host add local http://localhost:9000 minioadmin minioadmin
- Added `local` successfully.
-
- D:\tools\minio>mc.exe admin info local
- ● localhost:9000
- Uptime: 1 hour
- Version: 2021-10-23T03:28:24Z
-
-
- 12 MiB Used, 1 Bucket, 1 Object
- D:\tools\minio>mc.exe 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://localhost:9000
- AccessKey : minioadmin
- SecretKey : minioadmin
- 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
-
- D:\tools\minio>mc.exe admin service restart local
- Restart command successfully sent to `local`. Type Ctrl-C to quit or wait to follow the status of the restart process.
- ...
- Restarted `local` successfully in 2 seconds
-
- D:\tools\minio>