minio相关配置

说明

适用于centos7及以上

其他相关参考:https://github.com/minio/minio-service

配置文件

存放与 /etc/default/minio

  • 单服务器
# Volume to be used for MinIO server.
MINIO_VOLUMES="/opt/data/"
# Use if you want to run MinIO on a custom port.
MINIO_OPTS="--address :9199"
# Access Key of the server.
MINIO_ACCESS_KEY=admin
# Secret key of the server.
MINIO_SECRET_KEY=admin
  • 多服务器
MINIO_VOLUMES="http://192.168.1.201/opt/minio/data/sdb http://192.168.1.11/opt/minio/data/sdc http://192.168.1.11/opt/minio/data/sdd http://192.168.1.11/opt/minio/data/sde http://192.168.1.12/opt/minio/data/sdb http://192.168.1.12/opt/minio/data/sdc http://192.168.1.13/opt/minio/data/sdb http://192.168.1.13/opt/minio/data/sdc"
MINIO_OPTS="--address :9199"
MINIO_ACCESS_KEY=admin
MINIO_SECRET_KEY=admin
MINIO_REGION_NAME="中国华北一区"

服务脚本

命名为minio.service,保存至 /etc/systemd/system

[Unit]
Description=MinIO
Documentation=https://docs.min.io
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/opt/minio/minio

[Service]
WorkingDirectory=/opt/minio

#User=minio-user
#Group=minio-user

EnvironmentFile=/etc/default/minio
ExecStartPre=/bin/bash -c "if [ -z \"${MINIO_VOLUMES}\" ]; then echo \"Variable MINIO_VOLUMES not set in /etc/default/minio\"; exit 1; fi"

ExecStart=/opt/minio/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

# Built for ${project.name}-${project.version} (${project.name})

发表评论

电子邮件地址不会被公开。 必填项已用*标注