1.创建minio安装相关目录
mkdir /usr/local/minio
mkdir /usr/local/minio/bin
mkdir /usr/local/minio/etc
mkdir /usr/local/minio/data
2. 创建minio运行用户
groupadd -g 2019 minio
useradd -r -u 2019 -g 2019 -c "Minio User" -s /sbin/nologin minio
id minio
cat /etc/passwd
3.下载minio的二进制文件
note:
阿里云ecs网速过慢,建议直接去文档找链接下载,之后用xftp传至服务器
wget https://dl.minio.io/server/minio/release/linux-amd64/minio
#为minio文件赋予750权限
chmod 750 minio
./minio --help
#将下载的或传的minio放到规定位置
cp minio /usr/local/minio/bin
4. 创建minio配文件
note:
- 配置用户名和密码也在这里。
- myip位置填写私有ip,不能直接填写公网ip
vim /usr/local/minio/etc/minio.conf
#minio.conf文件内填写
MINIO_VOLUMES="/usr/local/minio/data"
MINIO_OPTS="-C /usr/local/minio/etc --address myip:9000"
MINIO_ACCESS_KEY="TEST"
MINIO_SECRET_KEY="12345678"
vim /etc/systemd/system/minio.service
#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
5. 更改文件、目录属主属组
chown -R minio:minio /usr/local/minio
6.启动服务
systemctl daemon-reload
systemctl enable minio.service
systemctl start minio.service
systemctl status minio.service
ps aux | grep minio
ss -tan | grep 9000
7.设置阿里云安全组规则
设置9000端口,相当于做nat映射
https://blog.csdn.net/lchu55/article/details/89916766
8.备注
note:
启动minio服务可能会失败,查看错误要去日志看详细错误
tail -500 /var/log/messages