docker-compose安装minio单机和集群 目录一、安装minio单机二、安装minio集群1、192.168.180.45配置2、其他服务器配置3、访问地址4、启用压缩5、压缩结果一、安装minio单机version:3services:minio:# image: minio/minio:RELEASE.2021-06-17T00-10-46Z# image: minio/minio:RELEASE.:RELEASE.2024-09-22T00-33-43Zimage:minio/minio:RELEASE.:RELEASE.2024-09-22T00-33-43Zvolumes:-/home/paas/minio/data:/data-/home/paas/minio/config:/root/.minioenvironment:-MINIO_ACCESS_KEYadmin-MINIO_SECRET_KEYadmin123456ports:-9000:9000-9001:9001command:server /data--console-address :9001restart:always二、安装minio集群ip用途192.168.180.45minio、nginx192.168.180.46minio192.168.180.47minio192.168.180.48minio1、192.168.180.45配置[rootapp01 minio_docker-compose]# vim docker-compose.yamlversion:3services: minio1: image: minio/minio:RELEASE.:RELEASE.2024-09-22T00-33-43Z container_name: minio1 network_mode: host ports:-9000:9000-9001:9001environment: MINIO_ROOT_USER: admin MINIO_ROOT_PASSWORD: admin123456 volumes:-./data:/datacommand: server--address:9000--console-address:9001http://192.168.180.45/datahttp://192.168.180.46/datahttp://192.168.180.47/datahttp://192.168.180.48/datahealthcheck: test:[CMD,curl,-f,http://localhost:9000/minio/health/live]interval: 30s timeout: 20s retries: 3 restart: always minio-gateway: image: nginx:1.19-alpine volumes:-./config/nginx.conf:/etc/nginx/nginx.conf ports:-29000:29000-29001:29001[rootapp01 minio_docker-compose]# vim config/nginx.confuser nginx;worker_processes auto;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;keepalive_timeout 65;upstream minio{server 192.168.180.45:9000;server 192.168.180.46:9000;server 192.168.180.47:9000;server 192.168.180.48:9000;}upstream minio-console{ip_hash;server 192.168.180.45:9001;server 192.168.180.46:9001;server 192.168.180.47:9001;server 192.168.180.48:9001;}server{listen 29000;listen[::]:29000;server_name localhost;ignore_invalid_headers off;client_max_body_size 0;client_body_buffer_size 0;proxy_buffering off;location/{proxy_set_header Host$http_host;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_connect_timeout 300;# Default is HTTP/1, keepalive is only enabled in HTTP/1.1proxy_http_version 1.1;proxy_set_header Connection;chunked_transfer_encoding off;proxy_pass http://minio;}}server{listen 29001;listen[::]:29001;server_name localhost;ignore_invalid_headers off;client_max_body_size 0;proxy_buffering off;proxy_request_buffering off;location/{proxy_set_header Host$http_host;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 X-NginX-Proxy true;real_ip_header X-Real-IP;proxy_connect_timeout 300;proxy_http_version 1.1;proxy_set_header Upgrade$http_upgrade;proxy_set_header Connectionupgrade;chunked_transfer_encoding off;proxy_pass http://minio-console;}}}2、其他服务器配置[roottest1 minio_docker-compose]# vim docker-compose.yamlversion:3services: minio1: image: minio/minio:RELEASE.:RELEASE.2024-09-22T00-33-43Z container_name: minio1 network_mode: host ports:-9000:9000-9001:9001environment: MINIO_ROOT_USER: admin MINIO_ROOT_PASSWORD: admin123456 volumes:-./data:/datacommand: server--address:9000--console-address:9001http://192.168.180.45/datahttp://192.168.180.46/datahttp://192.168.180.47/datahttp://192.168.180.48/datahealthcheck: test:[CMD,curl,-f,http://localhost:9000/minio/health/live]interval: 30s timeout: 20s retries: 3 restart: always3、访问地址http://192.168.180.45:29001/4、启用压缩mc aliassetnginxminio http://192.168.180.45:29000 admin admin123456 mc admin config get nginxminio compression mc admin configsetnginxminio compression enableonmc admin configsetnginxminio compression enableoff mc admin service restart nginxminio5、压缩结果940M的csv文件未压缩前磁盘占用 471*41884M启用压缩 62 *4248M