五. 安装与配置 Minio 单机版 并设置开机启动
1.安装 Minio
# mkdir -p /usr/local/minio/{data,bin,logs,config}
# cd /usr/local/minio/bin
# wget https://dl.min.io/server/minio/release/linux-amd64/minio
# chmod +x minio
2.配置启动脚本
# vim run.sh
#!/bin/bash
export MINIO_ROOT_USER=admin
export MINIO_ROOT_PASSWORD=admin123
/usr/local/minio/bin/minio server --config-dir /usr/local/minio/config --console-address ":19001" --address ":19000" \
/home/file/fnii \
> /usr/local/minio/logs/minio.log 2>&1
注: /home/file/fnii 为文件保存路径,需与run.sh中路径保持一致
# mkdir -p /home/file/fnii
# chmod +x run.sh
3.创建启动服务
# vim /usr/lib/systemd/system/minio.service
[unit]
Description=Minio service
Documentation=https://docs.minio.io/
[Service]
WorkingDirectory=/usr/local/minio/bin
ExecStart=/usr/local/minio/bin/run.sh
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
# chmod +x /usr/lib/systemd/system/minio.service
4.配置开机启动
- 服务生效
# systemctl daemon-reload
- 开机自启动
# systemctl enable minio
- 启动服务
# systemctl start minio
- 查看服务状态
# systemctl status minio
网友评论