下载地址:https://min.io/download
创建目录
mkdir -p /usr/local/minio/{data,bin,etc}
下载minio
wget https://dl.min.io/server/minio/release/linux-amd64/minio -P /usr/local/minio/lib/
授予minio文件执行权限
cd /usr/local/minio/bin && chmod +x minio
创建minio用户
useradd -s /sbin/nologin -d /var/lib/minio minio
更改minio相关目录、文件的所有者、所有组
chown -R minio:minio /usr/local/minio/
创建文件:/usr/local/minio/etc/minio.conf
MINIO_VOLUMES="/usr/local/minio/data"
#端口:默认9000
MINIO_OPTS="--address ':9000' --console-address ':9001'"
#登录名
#MINIO_ACCESS_KEY=minio #过期配置
MINIO_ROOT_USER=minio
#登录密码
#MINIO_SECRET_KEY=minio #过期配置
MINIO_ROOT_PASSWORD=minio
创建文件:/etc/systemd/system/minio.service
[Unit] Description=MinIO Documentation=https://docs.min.io Wants=network-online.target After=network-online.target AssertFileIsExecutable=/usr/local/minio/bin/minio [Service] # User and group User=minio Group=minio EnvironmentFile=/usr/local/minio/etc/minio.conf ExecStart=/usr/local/minio/bin/minio server $MINIO_OPTS $MINIO_VOLUMES # Let systemd restart this service always Restart=always # Specifies the maximum file descriptor number that can be opened by this process LimitNOFILE=65536 # Disable timeout logic and wait until process is stopped TimeoutStopSec=infinity SendSIGKILL=no [Install] WantedBy=multi-user.target
重新加载、生效minio.service文件(以上两个文件配置发生变更后需要执行)
systemctl daemon-reload
启动、关闭、查看进程状态、开机启动
systemctl start minio
systemctl stop minio
systemctl status minio
systemctl enable minio.service
防火墙放行端口:9000
firewall-cmd --zone=public --add-port=9000/tcp --permanent
firewall-cmd --zone=public --add-port=9001/tcp --permanent firewall-cmd --reload firewall-cmd --zone=public --list-ports
查看minio服务日志
journalctl -u minio.service
参考博客:
https://juejin.cn/post/6910016266258350087
https://ptp5.com/archives/107.html
为MinIO Server设置Nginx代理
参考文档:http://docs.minio.org.cn/docs/master/setup-nginx-proxy-with-minio
注:nginx和minio是安装在同一系统上的
修改nginx配置文件 /usr/local/nginx/conf/nginx.conf
我这边对外提供访问minio的端口号是19000,当浏览器访问 IP:19000 时,nginx会代理转发给 minio_gateway (即 localhost:9000)
登录账号名、密码 见 /usr/local/minio/etc/minio.conf 中的 MINIO_ROOT_USER、MINIO_ROOT_PASSWORD