CentOS 安装MINIO对象存储系统

本文共有3600个字。 # minio/ a

1、添加用户

useradd -s /sbin/nologin -d /opt/minio minio

2、创建软件目录

mkdir -p /opt/minio/bin

3、下载minio软件

wget https://dl.min.io/server/minio/release/linux-ppc64le/minio -O /opt/minio/bin/minio
chmod +x /opt/minio/bin/minio

4、创建配置文件

vim /opt/minio/minio.conf
MINIO_VOLUMES="/data/"
MINIO_OPTS="--address :9100"
MINIO_ACCESS_KEY= Somestrong_Access_key
MINIO_SECRET_KEY= Somestrong_Secret_key
:wq!

给文件夹权限

chown -R minio:minio /opt/minio

5、创建存储目录

mkdir /data
chown -R minio:minio /data

6、创建启动文件

vim /etc/systemd/system/minio.service
[Unit]
Description=Minio
Documentation=https://docs.minio.io
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/opt/minio/bin/minio
 
[Service]
WorkingDirectory=/opt/minio
User=minio
Group=minio
PermissionsStartOnly=true
EnvironmentFile=-/opt/minio/minio.conf
ExecStartPre=/bin/bash -c "[ -n \"${MINIO_VOLUMES}\" ] || echo \"Variable MINIO_VOLUMES not set in /opt/minio/minio.conf\""
ExecStart=/opt/minio/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

重载系统文件

systemctl daemon-reload

7、启动minio

systemctl start minio

8、创建跟随系统启动

systemctl enable minio

现在可以使用http://IP:9000 访问管理后台,如果系统开启防火墙,需要放行9000端口

9、配置nginx使用域名访问

server {
    listen 80;
    server_name  minio.domain.com www.minio.domain.com;
    #this config will force through ssl / https
    return 301 https://$server_name$request_uri;
    root /var/www/html;
    index index.html index.php;
    access_log /var/log/nginx/minio-access.log;
    error_log /var/log/nginx/minio-error.log;
    location / {
      proxy_pass          http://localhost:9100;
      }
   }
server {
     listen 443;
     server_name minio.domain.com www.minio.domain.com;
     ssl    on;
        
     #change max size upload file as you want
     client_max_body_size 300M;
        
     ssl_certificate         /path/to/ssl/certificate;
     ssl_certificate_key     /path/to/ssl/certificate_key;
     ssl_session_cache shared:SSL:1m;
     ssl_session_timeout  10m;
     ssl_ciphers HIGH:!aNULL:!MD5;
     ssl_prefer_server_ciphers on;
     access_log   /var/log/nginx/minio-access.log;
     error_log    /var/log/nginx/minio-error.log;
     root /var/www/html;
     index index.php;
     location / {
          proxy_pass          http://localhost:9100;
          proxy_set_header    Host             $host;
          proxy_set_header    X-Client-DN      $ssl_client_s_dn;
          proxy_set_header    X-SSL-Subject    $ssl_client_s_dn;
          proxy_set_header    X-SSL-Issuer     $ssl_client_i_dn;
          proxy_read_timeout 1800;
          proxy_connect_timeout 1800;
          }
}

测试nginx 配置是否正常

nginx -t

参考资料

Setup Minio Server on Centos 7 and Proxy Pass Using Nginx

Nginx Letsencrypt, Django and Minio

版权声明:本文为作者原创,如需转载须联系作者本人同意,未经作者本人同意不得擅自转载。本站微信公众号:7TEC,敬请关注!

暂时无法评论哦~

暂无评论