docker搭建minio集群

1、启动命令

分别在三台服务器上执行即可,需要修改下面http中的ip地址

docker run -id  \
--name=minio \
--restart=always \
--network=host \
-p 9000:9000 \
-p 9090:9090 \
-e "MINIO_ROOT_USER=minioadmin" \
-e "MINIO_ROOT_PASSWORD=minioadmin" \
-v /data/vprivacy/vprivacy-minio/data:/data1 \
-v /data/vprivacy/vprivacy-minio/data:/data2 \
minio/minio:RELEASE.2023-08-29T23-07-35Z server \
--console-address ":9090" -address ":9000" \
http://192.168.100.24{3...5}/data{1...2}

2、 配置负载均衡

nginx 需要对外开放 9000 9090 端口

# 注意ip  修改成对应的   
    upstream minio{
        server 192.168.100.243:9000;
        server 192.168.100.244:9000;
        server 192.168.100.245:9000;
    }
    upstream minio_server {
        server 192.168.100.243:9090;
        server 192.168.100.244:9090;
        server 192.168.100.245:9090;
    }

   server {
    listen          9000; 
    server_name      localhost;  
    location / {
        proxy_set_header        Host  $http_host;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass              http://minio;
        #添加了websocket支持  ---  不添加  桶打不开
        proxy_http_version      1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
      }
    }

    server {
    listen          9090;
    server_name     localhost;  
    location / {
        proxy_set_header        Host  $http_host;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass              http://minio_server;
         #添加了websocket支持  ---  不添加  桶打不开
        proxy_http_version      1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
      }
    }

posted @ 2023-10-24 17:44  买定灬离手  阅读(535)  评论(0编辑  收藏  举报