Minio集群部署
资源规划
IP |
服务规划 |
配置 |
192.168.116.138 |
minio-1 |
16核32G磁盘10T |
192.168.116.139 |
minio-2 |
16核32G磁盘10T |
192.168.116.140 |
minio-3 |
16核32G磁盘10T |
192.168.116.141 |
minio-4 |
16核32G磁盘10T |
192.168.116.128 |
nginx代理 |
8核16G磁盘500G |
基本环境配置
下面命令minio4台设备都要执行
[root@minio-1 ~]
192.168.116.138 minio-1
192.168.116.139 minio-2
192.168.116.140 minio-3
192.168.116.141 minio-4
EOF
[root@minio-1 ~]
下载文件
[root@minio-1 ~]
[root@minio-1 app]
创建启动命令
[root@minio-1 app]
export MINIO_ROOT_USER=admin
export MINIO_ROOT_PASSWORD=admin@123
nohup /home/minio/app/minio server --config-dir /home/minio/config --console-address ":9001" \
http://minio-1:9000/home/minio/data http://minio-2:9000/home/minio/data http://minio-3:9000/home/minio/data http://minio-4:9000/home/minio/data > /home/minio/logs/start.log 2>&1 &
echo "MinIO started with PID: $!"
EOF
[root@minio-1 app]
[root@minio-1 app]
[root@minio-1 app]
[root@minio-2 app]
[root@minio-3 app]
[root@minio-4 app]
配置负载均衡
192.168.116.128 机器
[root@nginx-minio ~]
[root@nginx-minio conf.d]
upstream minio-console {
server 192.168.116.138:9001 max_fails=3 fail_timeout=5s;
server 192.168.116.139:9001 max_fails=3 fail_timeout=5s;
server 192.168.116.140:9001 max_fails=3 fail_timeout=5s;
server 192.168.116.141:9001 max_fails=3 fail_timeout=5s;
}
upstream minio-api {
server 192.168.116.138:9000 max_fails=3 fail_timeout=5s;
server 192.168.116.139:9000 max_fails=3 fail_timeout=5s;
server 192.168.116.140:9000 max_fails=3 fail_timeout=5s;
server 192.168.116.141:9000 max_fails=3 fail_timeout=5s;
}
server {
listen 9001;
server_name _;
access_log /home/minio/logs/minio.com_access.log main;
error_log /home/minio/logs/minio.com_error.log warn;
location / {
proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://minio-console;
expires 0;
}
}
server {
listen 9000;
server_name _;
access_log /home/minio/logs/minio.com_access.log main;
error_log /home/minio/logs/minio.com_error.log warn;
location / {
proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://minio-api;
expires 0;
}
}
[root@nginx-minio conf.d]
访问http://192.168.116.128:9001/tools/metrics