[Unit]
Description=MinIO
Documentation=https://min.io/docs/minio/linux/index.html
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/usr/local/bin/minio
[Service]
WorkingDirectory=/usr/local
User=minio
Group=minio
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=/usr/local/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
# 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
# MINIO_ROOT_USER and MINIO_ROOT_PASSWORD sets the root account for the MinIO server.# This user has unrestricted permissions to perform S3 and administrative API operations on any resource in the deployment.# Omit to use the default values 'minioadmin:minioadmin'.# MinIO recommends setting non-default values as a best practice, regardless of environmentMINIO_ROOT_USER=myminioadmin
MINIO_ROOT_PASSWORD=minio-secret-key-change-me
MINIO_ADDRESS=":9000"MINIO_CONSOLE_ADDRESS=":9001"# MINIO_VOLUMES sets the storage volume or path to use for the MinIO server.MINIO_VOLUMES="/mnt/data"# MINIO_SERVER_URL sets the hostname of the local machine for use with the MinIO Server# MinIO assumes your network control plane can correctly resolve this hostname to the local machine# Uncomment the following line and replace the value with the correct hostname for the local machine.# 配置 API 域名#MINIO_SERVER_URL="http://minio.example.net"# 控制台域名# MINIO_BROWSER_REDIRECT_URL="http://console.minio.example.net"