中文文档:http://docs.minio.org.cn/docs/
安装篇:
简单安装下载启动
wget https://dl.minio.io/server/minio/release/linux-amd64/minio
chmod +x minio
mv minio /usr/local/bin
mkdir -p /data/minio
minio server /data/minio //后面的是数据目录
1、将Minio设置成服务
以上步骤中,如果Ctrl+C退出之后,这个Minio服务也就同时停止了,所以如果需要它在后台进行服务,需要将它添加到后台服务中。(默认你在root权限=-=,不加sudo)
1、首先需要添加minio用户,以及建一个Minio文件夹
sudo groupadd -g 2021 minio-user
sudo useradd -r -M -u 2021 -g 2021 -c "Minio User" -s /sbin/nologin minio-user
sudo adduser minio-user
sudo mkdir -p /data/minio
sudo chown minio-user:minio-user /data/minio
2、建立一个配置文件,并更新你的Key值
vim /etc/default/minio
MINIO_ROOT_USER="admin"
MINIO_ROOT_PASSWORD="dwsf99819981"
MINIO_VOLUMES="/data/minio/"
MINIO_OPTS="--address :9000 --console-address :9090"
3、新建一个minio.service 在 /etc/systemd/system
执行:
sudo vim /etc/systemd/system/minio.service
将下面的配置复制到minio.service
[Unit]
Description=Minio
Documentation=https://docs.minio.io
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/usr/local/bin/minio
[Service]
WorkingDirectory=/usr/local/
User=minio-user
Group=minio-user
PermissionsStartOnly=true
EnvironmentFile=-/etc/default/minio
ExecStartPre=/bin/bash -c "[ -n \"${MINIO_VOLUMES}\" ] || echo \"Variable MINIO_VOLUMES not set in /etc/default/minio\""
ExecStart=/usr/local/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、正式启用和查看状态
systemctl enable minio.service
systemctl daemon-reload
systemctl start minio
systemctl status minio.service
systemctl stop minio
开放端口
sudo ufw allow 9000/tcp