一、安装及测试

1、安装

useradd -s /sbin/nologin -d /opt/minio minio
mkdir -p /opt/minio/bin
mkdir /opt/minio/data
wget https://dl.minio.io/server/minio/release/linux-amd64/minio -O /opt/minio/bin/minio
chmod +x /opt/minio/bin/minio
chown -R minio:minio /opt/minio

2、添加配置文件

vi /opt/minio/minio.conf

MINIO_VOLUMES=/opt/minio/data
MINIO_OPTS="--address :9090"
MINIO_ACCESS_KEY=[YOUR_ACCESS_KEY]
MINIO_SECRET_KEY=[YOUR_SECRET_KEY]

3、添加系统服务

vi /etc/systemd/system/minio.service

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

[Service]
WorkingDirectory=/opt/minio

User=minio
Group=minio

PermissionsStartOnly=true

EnvironmentFile=-/opt/minio/minio.conf
ExecStartPre=/bin/bash -c "[ -n \"${MINIO_VOLUMES}\" ] || echo \"Variable MINIO_VOLUMES not set in /opt/minio/minio.conf\""

ExecStart=/opt/minio/bin/minio server $MINIO_OPTS $MINIO_VOLUMES

StandardOutput=journal
StandardError=inherit

# 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=0

# SIGTERM signal is used to stop Minio
KillSignal=SIGTERM

SendSIGKILL=no

SuccessExitStatus=0

[Install]
WantedBy=multi-user.target

4、启动Minio服务

systemctl enable minio
systemctl start minio
systemctl status minio

PS:默认minio的监听端口是:9000,我在配置文件中改成了9090,所以可以通过:
http://host:9090访问minio后台。