服务脚本方式启动
1、启动脚本
#!/bin/bash
export MINIO_ACCESS_KEY=minio
export MINIO_SECRET_KEY=minio123
/xiyou/software/minio server http://192.168.1.1/minio_data http://192.168.1.2/minio_data http://192.168.1.3/minio_data http://192.168.1.4/minio_data
新版配置中 MINIO_ROOT_USER 替换 MINIO_ACCESS_KEY;MINIO_ROOT_PASSWORD 替换 MINIO_SECRET_KEY
2、服务脚本
vim /usr/lib/systemd/system/minio.service
---------------------------------------------------------------------------------------
[Unit]
Description=Minio service
Documentation=https://docs.minio.io/
[Service]
WorkingDirectory=/data/minio-cluster/
ExecStart=/data/minio-cluster/start.sh
Restart=on-failure
RestartSec=5
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
--------------------------------------------------------------------------------------
chmod +x /usr/lib/systemd/system/minio.service
参考minio.service配置: https://github.com/minio/minio-service/blob/master/linux-systemd/minio.service
3、服务启动
chmod +x /opt/minio/run.sh
systemctl daemon-reload
systemctl enable minio
systemctl start minio
systemctl status minio
4、查看服务日志
journalctl -u 服务名
5、启动脚本后,浏览器打开网址进行测试 127.0.0.1:9001