centos7 minio

一、下载二进制文件

wget https://dl.minio.org.cn/server/minio/release/linux-amd64/minio

二、授权,并移动到指定目录

chmod +x minio

sudo mv minio /usr/local/bin/

二、创建服务文件

/usr/lib/systemd/system/minio.service

内容如下:
[Unit]

Description=MinIO

Documentation=https://minio.org.cn/docs/minio/linux/index.html

Wants=network-online.target

After=network-online.target

AssertFileIsExecutable=/usr/local/bin/minio

[Service]

WorkingDirectory=/usr/local

User=root

Group=root

ProtectProc=invisible

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

MinIO RELEASE.2023-05-04T21-44-30Z adds support for Type=notify (https://www.freedesktop.org/software/systemd/man/systemd.service.html#Type=)

This may improve systemctl setups where other services use After=minio.server

Uncomment the line to enable the functionality

Type=notify

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

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


/etc/default/minio创建环境变量文件
MINIO_VOLUMES="/tools/minio-data"
MINIO_OPTS="--address :9000 --console-address :9001"
MINIO_ACCESS_KEY=minioadmin
MINIO_SECRET_KEY=Newland123!

启动服务

sudo systemctl enable minio.service

sudo systemctl start minio.service

六、查询服务是否正常

sudo systemctl status minio.service

journalctl -f -u minio.service

posted @ 2025-05-21 11:07  博小群  阅读(42)  评论(0)    收藏  举报