# vim  /etc/systemd/system/minio.service

####################################################################

[Unit]

Description=MinIO

Documentation=https://docs.min.io

Wants=network-online.target

After=network-online.target

AssertFileIsExecutable=/usr/local/minio/bin/minio

[Service]

# User and group

User=minio

Group=minio

EnvironmentFile=/usr/local/minio/etc/minio.conf

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

# Disable timeout logic and wait until process is stopped

TimeoutStopSec=infinity

SendSIGKILL=no

[Install]

WantedBy=multi-user.target

####################################################################


四、 配置minio的SSL/TLS

从上面可以看出,minio启动后会在 etc目录下生成证书文件目录,在data目录下生成隐藏文件夹,里面有登录相关配置

1.生成私钥和自签名证书

# yum  -y install openssl

# openssl req -x509 -nodes  \

-sha512  \

-newkey rsa:2048 \

-days 365 \

-subj "/C=CN/ST=Gunagdong/L=Shenzhen/O=Test/OU=Test/CN=www.example.com" \

-keyout private.key \

-out public.crt

编辑配置文件,定义环境变量

MINIO_ACCESS_KEY:用户名,最少三个字符

MINIO_SECRET_KEY:密钥,最少八个字符


#  vim /usr/local/minio/etc/minio.conf

#######################################################

MINIO_VOLUMES="/usr/local/minio/data"

MINIO_OPTS="-C /usr/local/minio/etc --address 192.168.1.103:9000"

MINIO_ACCESS_KEY="admin"

MINIO_SECRET_KEY="Admin@123"

########################################################