下载
wget https://dl.min.io/server/minio/release/linux-amd64/miniochmod +x miniomv minio /usr/local/bin
部署脚本
mkdir -p /data1 /data2 /data3 /data4vim minio-cluster.sh#!/bin/bashexport MINIO_ACCESS_KEY=minioexport MINIO_SECRET_KEY=minio123minio server http://10.161.17.226/data1 \http://10.161.17.226/data2 \http://10.161.17.226/data3 \http://10.161.17.226/data4
注册为系统服务
vim /usr/lib/systemd/system/minio.service# vim /etc/systemd/system/minio.service #ubuntu下的启动脚本---------------------------------------------------------------------------------------[Unit]Description=Minio serviceDocumentation=https://docs.minio.io/[Service]WorkingDirectory=/xiyou/software/ExecStart=/opt/minio/run.shRestart=on-failureRestartSec=5# Specifies the maximum file descriptor number that can be opened by this processLimitNOFILE=65536[Install]WantedBy=multi-user.target--------------------------------------------------------------------------------------chmod +x /usr/lib/systemd/system/minio.service #centos的启动脚本# chmod +x /etc/systemd/system/minio.service #ubuntu的启动脚本#参考minio.service配置: https://github.com/minio/minio-service/blob/master/linux-systemd/minio.service
3.服务启动
chmod +x /opt/minio/run.shsystemctl daemon-reload #刷新配置systemctl enable miniosystemctl start miniosystemctl status minio
nginx配置
#安装好nginx之后就可以启动nginxsystemctl start nginx#查看下端口监听netstat -lntup|grep 80#查看下nginx.conf文件的配置cat /etc/nginx/nginx.conf----------------------------------------------------------------------------------user nginx;worker_processes 1;error_log /var/log/nginx/error.log warn;pid /var/run/nginx.pid;events { worker_connections 1024;}http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 65; gzip on; #include /etc/nginx/conf.d/*.conf; upstream minio_servers { ip_hash; server 10.211.55.5:9000; server 10.211.55.8:9000; server 10.211.55.9:9000; server 10.211.55.10:9000; } server { listen 80; server_name minio.dev.com; location / { proxy_set_header Host $host; proxy_pass http://minio_servers; proxy_redirect off; #proxy_set_header X-Real-IP $remote_addr; #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; #client_body_buffer_size 10M; #缓冲区代理缓冲请求的最大字节数 #client_max_body_size 10G; #客户端最大文件上传大小为10G #proxy_buffers 1024 4k; #proxy_read_timeout 300; #proxy_next_upstream error timeout http_404; } }}--------------------------------------------------------------------------------#location 内的注释的字段,建议可以在查看后根据需求修改#可参考 https://docs.min.io/cn/setup-nginx-proxy-with-minio.html#https://www.nginx.com/blog/enterprise-grade-cloud-storage-nginx-plus-minio/