minio 集群部署

minio 集群部署

#准备minio 节点
172.24.119.49    172.24.119.41
172.24.119.50    172.24.119.48 


#分别创建目录
172.24.119.49 /data/minio8 
172.24.119.41 /data/minio5    
172.24.119.50 /data/minio7  
172.24.119.48 /data/minio6


#下载minio (4个节点都操作)
wget https://dl.minio.io/server/minio/release/linux-amd64/minio
mkdir /opt/minio  
mv minio  /opt/minio  

#准备minio 配置文件 run.sh  (4个机器配置文件一致)
$ cat run.sh 
#!/bin/bash
export MINIO_ACCESS_KEY=minio              #登录minio 账号
export MINIO_SECRET_KEY=123456        #登录minio 密码

/opt/minio/minio server --config-dir /etc/minio \
http://172.24.119.49/data/minio8 http://172.24.119.41/data/minio5 \
http://172.24.119.50/data/minio7 http://172.24.119.48/data/minio6 

#准备启动文件 (4个机器一致)
cat /usr/lib/systemd/system/minio.service
[Unit]
Description=Minio service
Documentation=https://docs.minio.io/

[Service]
WorkingDirectory=/opt/minio/
ExecStart=/opt/minio/run.sh

Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target


#启动minio 
systemctl start minio


#lvs 配置nginx 
cat minio.conf
upstream minio-server {
    server 172.24.119.49:9000 weight=25 max_fails=2 fail_timeout=30s;
    server 172.24.119.41:9000 weight=25 max_fails=2 fail_timeout=30s;
    server 172.24.119.50:9000 weight=25 max_fails=2 fail_timeout=30s;
    server 172.24.119.48:9000 weight=25 max_fails=2 fail_timeout=30s;
}
server {
    listen 80;
    listen 443;
    server_name minio-aaa.com ;
    ssl on;
   ssl_certificate   /usr/local/nginx/conf/cert/k8s/3877901__aaa.com.pem;
   ssl_certificate_key  /usr/local/nginx/conf/cert/k8s/3877901__aaa.com.key;
    charset utf-8;
    default_type text/html;
    location /{
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-For $remote_addr;
        client_body_buffer_size 10M;
        client_max_body_size 10G;
        proxy_buffers 1024 4k;
        proxy_read_timeout 300;
        proxy_next_upstream error timeout http_404;
        proxy_pass http://minio-server;
    }
    error_log   /data1/logs/minio/error.log;
    access_log  /data1/logs/minio/access.log  access;
}

posted @ 2021-03-02 09:58  lixinliang  阅读(852)  评论(0编辑  收藏  举报