1.下载地址 MinIO | Code and downloads to create high performance object storage
2.创建文件相关文件夹 mkdir
3.赋权
chomd +x minio
4.创建用户组和租户
groupadd minio
###
useradd minio -g minio
### 验证
cat /etc/passwd
5.创建配置文件
vi minio.conf
MINIO_VOLUMES="/dat/minIO/data"
MINIO_OPTS="-C /dat/minIO/etc --console-address 100.1.4.21:9001"
MINIO_ACCESS_KEY="***"
MINIO_SECRET_KEY="***"
6.创建服务
vi /etc/systemd/system/minio.service
[Unit]
Description=MinIO
Documentation=https://docs.min.io
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/dat/minIO/bin/minio
[Service]
# User and group
User=minio
Group=minio
EnvironmentFile=/dat/minIO/etc/minio.conf
ExecStart=/dat//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
7.授权mino目录
chown minio.minio /dat/minIO -R
8.启动服务
### 服务加载
systemctl daemon-reload
### 开机启动
systemctl enable minio.service
### 停止开机启动
systemctl disable minio.service
### 启动
systemctl start minio.service
### 状态
systemctl status minio.service
### 停止
systemctl stop minio.service
9.Nginx代理(代理console-address)
补增加websocket配置,访问bucket会报错。
### minio 代理配置
location /{
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_connect_timeout 300;
proxy_http_version 1.1;
proxy_set_header Connection "";
chunked_transfer_encoding off;
proxy_pass http://100.1.4.21:9001;
# 添加了websocket支持
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_headers_hash_max_size 51200;
proxy_headers_hash_bucket_size 6400;
# websocket配置完成
}
### Buckets 桶代理
location /chief {
proxy_read_timeout 600s;
# 配置minio访问地址与桶名
proxy_pass http://101.490.250.6:9594/chief;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Special-Delivery "";
proxy_set_header Access-Control-Allow-Origin "";
proxy_set_header Proxy-Client-IP $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}