1. 创建数据目录
# 数据存储目录
mkdir -p /mnt/c/aipc/minio # 日志存储目录
cd /mnt/c/aipc/minio
mkdir -p logs conf data
chmod -R 777 /mnt/c/aipc/minio
2. 安装
wget https://dl.min.io/server/minio/release/linux-amd64/minio
# 将下载所得minio文件拷贝到指定文件夹并赋权
sudo cp minio /usr/local/bin/
sudo chmod +x /usr/local/bin/minio
# 启动
sudo minio server /data/minio --console-address ":9090"
3.配置文件
vim /mnt/c/aipc/minio/conf/minio.conf
# 指定数据存储目录(注意:这个目录要存在且拥有相对应的权限)
MINIO_VOLUMES="/mnt/c/aipc/minio/data"
# 监听端口
# --address:是指定api的端口;--console-address:是指定控制台端口
MINIO_OPTS="--address :9000 --console-address=0.0.0.0:9090"
# 老版本使用MINIO_ACCESS_KEY/MINIO_SECRET_KEY,新版本已不建议使用
# Access key (账号)
# MINIO_ACCESS_KEY="asjuser"
# Secret key (密码)
# MINIO_SECRET_KEY="ajs@RN188588"
# 新版本使用;指定默认的用户名和密码,其中用户名必须大于3个字母,否则不能启动
MINIO_ROOT_USER="asjuser"
MINIO_ROOT_PASSWORD="ajs@RN188588"
# 区域值,标准格式是“国家-区域-编号”,
MINIO_REGION="cn-beijing-1"
# 域名
# MINIO_DOMAIN=minio.your_domain.com
4. 创建开机自启动
创建一个service文件
vim /usr/lib/systemd/system/minio.service
[Unit]
Description=MinIO
Documentation=https://docs.min.io
Wants=network-online.target
After=network-online.target
# 指向minio的存在路径
AssertFileIsExecutable=/usr/local/bin/minio
[Service]
# 工作目录,指minio文件的存放目录
WorkingDirectory=/mnt/c/aipc/minio/data
ProtectProc=invisible
# 指向minio的配置文件
EnvironmentFile=/mnt/c/aipc/minio/conf/minio.conf
ExecStartPre=/bin/bash -c "if [ -z \"${MINIO_VOLUMES}\" ]; then echo \"Variable MINIO_VOLUMES not set in /mnt/c/aipc/minio/conf/minio.conf\"; exit 1; fi"
ExecStart=/usr/local/bin/minio server $MINIO_OPTS $MINIO_VOLUMES
# Let systemd restart this service always
Restart=always
# Specifies the maximum (1M) 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
TimeoutStopSec=infinity
SendSIGKILL=no
SuccessExitStatus=0
[Install]
WantedBy=multi-user.target
Alias=minio.service
4. 使服务生效
# 重新加载服务配置文件,使服务生效
systemctl daemon-reload
# 将服务设置为开机启动
systemctl enable minio
# 服务立即启动
systemctl restart minio
# 查看minio服务当前状态
systemctl status minio
标签:LTS,bin,MinIO,minio,mnt,aipc,22.04,conf,MINIO From: https://www.cnblogs.com/edeny/p/18515558