minio gateway nas 参考配置
原创
©著作权归作者所有:来自51CTO博客作者rongfengliang的原创作品,请联系作者获取转载授权,否则将追究法律责任
主要记录下运行说明
参考命令
/usr/local/bin/minio gateway nas --help
NAME:
minio gateway nas - Network-attached storage (NAS)
USAGE:
minio gateway nas [FLAGS] PATH
FLAGS:
--address value bind to a specific ADDRESS:PORT, ADDRESS can be an IP or hostname (default: ":9000")
--certs-dir value, -S value path to certs directory (default: "/root/.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
PATH:
path to NAS mount point
EXAMPLES:
1. Start minio gateway server for NAS backend
$ export MINIO_ROOT_USER=accesskey
$ export MINIO_ROOT_PASSWORD=secretkey
$ minio gateway nas /shared/nasvol
2. Start minio gateway server for NAS with edge caching enabled
$ export MINIO_ROOT_USER=accesskey
$ export MINIO_ROOT_PASSWORD=secretkey
$ export MINIO_CACHE_DRIVES="/mnt/drive1,/mnt/drive2,/mnt/drive3,/mnt/drive4"
$ export MINIO_CACHE_EXCLUDE="bucket1/*,*.png"
$ export MINIO_CACHE_QUOTA=90
$ export MINIO_CACHE_AFTER=3
$ export MINIO_CACHE_WATERMARK_LOW=75
$ export MINIO_CACHE_WATERMARK_HIGH=85
$ minio gateway nas /shared/nasvol
推荐玩法
推荐配置cache,可以加速访问
systemd 配置
minio.service
[Unit]
Description=MinIO
Documentation=https://docs.min.io
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/usr/local/bin/minio
[Service]
WorkingDirectory=/usr/local
User=root
Group=root
EnvironmentFile=-/etc/default/minio # 以上配置到文件中
ExecStart=/usr/local/bin/minio gateway nas /data/Prod/
# Let systemd restart this service always
Restart=always
# Specifies the maximum file descriptor number that can be opened by this process
LimitNOFILE=65536
# Specifies the maximum number of threads this process can create
TasksMax=infinity
# Disable timeout logic and wait until process is stopped
TimeoutStopSec=infinity
SendSIGKILL=no
[Install]
WantedBy=multi-user.target
# Built for ${project.name}-${project.version} (${project.name})
minio 配置
MINIO_BROWSER=off
# Root user for the server.
MINIO_ROOT_USER=xxxx
# Root secret for the server.
MINIO_ROOT_PASSWORD=xxxx
MINIO_CACHE_QUOTA=90
MINIO_CACHE_AFTER=3
MINIO_CACHE_WATERMARK_LOW=70
MINIO_CACHE_WATERMARK_HIGH=90
MINIO_CACHE_DRIVES="/cache" # cache
说明
minio gateway 能力,实际上6.1 之后的版本已经下线了, 部署的时候注意版本需要使用老的
参考资料
https://github.com/minio/minio/blob/master/docs/disk-caching/DESIGN.md
https://blog.min.io/deprecation-of-the-minio-gateway/
https://github.com/minio/minio/issues/14331
https://github.com/minio/minio/blob/master/docs/gateway/nas.md