下载rpm包 https://dl.min.io/server/minio/release/linux-amd64/
当时下载的版本:minio-20240803043323.0.0-1.x86_64.rpm
安装minio
rpm -ivh minio-20230210184839.0.0.x86_64.rpm
设置minio的启动用户
编辑minio的启动文件
vim /usr/lib/systemd/system/minio.service
将User和Group都指定为root
新版本的minio这里TimeoutSec参数名称错了,将 TimeoutSec 修改为 TimeoutStopSec,否则启动报错。
完整配置
[Unit]
Description=MinIO
Documentation=https://docs.min.io
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/usr/local/bin/minio
[Service]
Type=notify
WorkingDirectory=/usr/local
#修改1
User=root
Group=root
EnvironmentFile=-/etc/default/minio
#修改2
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=1048576
# Specifies the maximum number of threads this process can create
TasksMax=infinity
# Disable timeout logic and wait until process is stopped
#修改3
TimeoutStopSec=infinity
SendSIGKILL=no
[Install]
WantedBy=multi-user.target
# Built for ${project.name}-${project.version} (${project.name})
编辑完成后复制到/etc/systemd/system/
cp /usr/lib/systemd/system/minio.service /etc/systemd/system/
创建数据存储目录
cd /opt
mkdir miniodata
cd miniodata
mkdir data
设置权限
chomd -x miniodata
创建minio启动配置文件
vim /etc/default/minio
#添加配置参数
MINIO_VOLUMES="/opt/miniodata/data"
#9001控制台地址,9000文件地址,记得开启防火墙端口
MINIO_OPTS="--address :9000 --console-address :9001"
MINIO_ACCESS_KEY=minioadmin #登录账号
MINIO_SECRET_KEY=minioadmin
#关闭防火墙,或者开放端口
firewall-cmd --zone=public --add-port=9000/tcp --permanent
firewall-cmd --zone=public --add-port=9001/tcp --permanent
firewall-cmd --reload
firewall-cmd --list-port
刷新
systemctl daemon-reload
#启动
systemctl start minio
#设置开机自启动
#systemctl enable minio
#查看状态
systemctl status minio
#访问
http://ip:9001/login