中文英文文档位置
http://docs.minio.org.cn/docs/
https://min.io/docs/minio/linux/developers/go/API.html
说明:
engineercms提供文件访问,必须位于它文件夹attachment下,文件放到到其他地方就访问不了了,需要用一个分布式存储。类似你购买一些云存储。
如果有大量文件需要存储,一个硬盘不够,用minio这个分布式存储,多磁盘对应minio的集群部署。
类似的分布式文件存储服务有go_fastdfs等等。
1 运行minio服务
win环境里下载编译好的exe文件,在官网下载,下载MINIO SERVER即可,或者在我网盘里有编译好的。如果有go环境,可以自己下载源码编译。见官方文档。
cmd进入文件夹内运行命令,以下命令将e盘作为文件存储空间,已有的文件夹将自动作为bucket(桶):
minio.exe server e:\
运行后如下,记住在engineercms的app.conf里填写下文API里对应的http://10.0.75.1:9000
,不要用127.0.0.1
或localhost之类,也不要填下文的第一个ip3.1.1.156
(好像每次启动都会变化)。
D:\gowork\src\github.com\minio\minio>minio.exe server e:\
Warning: Default parity set to 0. This can lead to data loss.
WARNING: Detected default credentials 'minioadmin:minioadmin', we recommend that you change these values with 'MINIO_ROOT_USER' and 'MINIO_ROOT_PASSWORD' environment variables
MinIO Object Storage Server
Copyright: 2015-0000 MinIO, Inc.
License: GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>
Version: DEVELOPMENT.GOGET (go1.19.4 windows/amd64)
Status: 1 Online, 0 Offline.
API: http://3.1.1.156:9000 http://192.168.101.24:9000 http://10.0.75.1:9000 http://192.168.32.1:9000 http://127.0.0.1:9000
RootUser: minioadmin
RootPass: minioadmin
Console: http://3.1.1.156:53202 http://192.168.101.24:53202 http://10.0.75.1:53202 http://192.168.32.1:53202 http://127.0.0.1:53202
RootUser: minioadmin
RootPass: minioadmin
Command-line: https://min.io/docs/minio/linux/reference/minio-mc.html#quickstart
$ mc.exe alias set myminio http://3.1.1.156:9000 minioadmin minioadmin
Documentation: https://min.io/docs/minio/linux/index.html
minio跑起来了,就用浏览器进入http://10.0.75.1:9000
管理页面,浏览器会自动跳转至http://10.0.75.1:53202
,这个53202
端口号是每次启动都变化的,但对于engineercms来说,是用API地址和端口http://10.0.75.1:9000
,是不变的。
输入用户名和密码都输入minioadmin
登录即可。
第一步 先建立一个buckets(桶),其实就是一个文件夹,命名为engineecms
或其他,这个名称和engineercms里app.conf(见下文)里的设置一至。
第二步 设置匿名永久访问链接权限,否则在engineercms里是无法预览图片
点击刚刚建立的buckets: engineercms 进入设置页面,看到 access policy
,点击后选择public
确认一下 anonymous 匿名访问规则是不是readwrite,其实readonly就行了。
这样设置后,其实就可以在浏览器里直接输入地址看到文件或下载图片(预览图片),注意,地址不要用127或localhost之类,ip和端口不要用那个随机变化的3.1.1.156:53202
这种,要用固定地址+9000端口号就行了。如下:http://10.0.75.1:9000/engineercms/秦晓川.jpg
第三步 设置API调用密钥之类,为的是engineercms上传和下载
点击文本框右侧的眼睛图标,将它们记录下来写入下文app.conf里
2 engineercms配置
打开app.conf
######相册文件夹映射路径########
photopath = /attachment/pass-001mathcad云计算书/
######minio分布式存储设置######
useminio = true
minio_endpoint = 10.0.75.1:9000
accessKeyID = FjtR8D8nvAQuAG3h
secretAccessKey = M3NSzXVmuuArai7xBMuZIKOgOXuKovxi
useSSL = false
minio_bucketname = engineercms
启动engineercms.exe,进行照片上传或视频上传。
相册:https://zsj.itdos.net/docs/engineercms_008/engineercms_008_001
视频配置:https://zsj.itdos.net/docs/engineercms_008/engineercms_008_002
##########***以下为无关文件,不用看#############
参考资料地址
https://blog.csdn.net/u011174699/article/details/124903036
https://www.codenong.com/40956103/
https://www.h5w3.com/235769.html
https://blog.csdn.net/qq_33192671/article/details/127958701
https://blog.csdn.net/ACTIVE18/article/details/126159252
https://min.io/docs/minio/linux/developers/go/API.html#PutObject
http://docs.minio.org.cn/docs/
https://zhuanlan.zhihu.com/p/565697106
docker安装笔记
github.com/minio/minio/internal/config/notify
github.com/minio/minio/cmd
github.com/minio/minio
2023/01/07 13:53:15 SUCCESS ▶ 0004 Built Successfully!
2023/01/07 13:53:15 INFO ▶ 0005 Restarting 'minio.exe'...
2023/01/07 13:53:15 SUCCESS ▶ 0006 './minio.exe' is running...
NAME:
minio.exe - High Performance Object Storage
DESCRIPTION:
Build high performance data infrastructure for machine learning, analytics and application data workloads with MinIO
USAGE:
minio.exe [FLAGS] COMMAND [ARGS...]
COMMANDS:
server start object storage server
FLAGS:
--certs-dir value, -S value path to certs directory (default: "C:\\Users\\Administrator\\.minio\\certs")
--quiet disable startup and info messages
--anonymous hide sensitive information from logging
--json output logs in JSON format
--help, -h show help
--version, -v print the version
VERSION:
DEVELOPMENT.GOGET
^C
D:\gowork\src\github.com\minio\minio>minio.exe server e:\
Formatting 1st pool, 1 set(s), 1 drives per set.
WARNING: Host local has more than 0 drives of set. A host failure will result in data becoming unavailable.
Warning: Default parity set to 0. This can lead to data loss.
WARNING: Detected default credentials 'minioadmin:minioadmin', we recommend that you change these values with 'MINIO_ROOT_USER' and 'MINIO_ROOT_PASSWORD' environment variables
MinIO Object Storage Server
Copyright: 2015-0000 MinIO, Inc.
License: GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>
Version: DEVELOPMENT.GOGET (go1.19.4 windows/amd64)
Status: 1 Online, 0 Offline.
API: http://3.1.1.38:9000 http://192.168.101.24:9000 http://10.0.75.1:9000 http://172.25.64.1:9000 http://127.0.0.1:9000
RootUser: minioadmin
RootPass: minioadmin
Console: http://3.1.1.38:59735 http://192.168.101.24:59735 http://10.0.75.1:59735 http://172.25.64.1:59735 http://127.0.0.1:59735
RootUser: minioadmin
RootPass: minioadmin
Command-line: https://min.io/docs/minio/linux/reference/minio-mc.html#quickstart
$ mc.exe alias set myminio http://3.1.1.38:9000 minioadmin minioadmin
Documentation: https://min.io/docs/minio/linux/index.html
D:\gowork\pkg\mod\github.com\minio\minio-go\v7@v7.0.46\api.go
最后编辑:秦晓川 更新时间:2024-12-08 00:39