minio分布式部署

heiu

原文链接:https://blog.csdn.net/yeyiboy/article/details/113118815
一、至少准备四个节点

1
2
3
4
192.168.0.100    m1
192.168.0.101 m2
192.168.0.102 m3
192.168.0.103 m4

二、部署(在m1机器上进行目录的创建)

1、创建相关目录

1
mkdir -p /usr/local/minio/{bin,etc,data1,data2}

2、下载minio文件

1
2
3
wget https://dl.min.io/server/minio/release/linux-amd64/minio
cp minio /usr/local/minio/bin/
chmod +x /usr/local/minio/bin/minio

3、编辑启动脚本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
vim /usr/local/minio/bin/minioStart.sh

#!/bin/bash
export MINIO_ACCESS_KEY=admin #用户名
export MINIO_SECRET_KEY=admin #密码



ETC=/usr/local/minio/
BIN=/usr/local/minio/

nohup $BIN/minio server --config-dir $ETC/minio --address "0.0.0.0:9400" http://192.168.0.100:9400/home/microShopProje
ct/minio/data http://192.168.0.100:9400/home/microShopProject/minio/data1 http://192.168.0.101:9400/home/microShop
Project/minio/data http://192.168.0.101:9400/home/microShopProject/minio/data1 > /home/microShopProject/minio/log/mini
o.log & 2>&1

#$BIN/minio server --config-dir $ETC/minio \
#--address "0.0.0.0:9400" \

#http://192.168.0.100/usr/local/minio/data
#http://192.168.0.100/usr/local/minio/data1
#http://192.168.0.101/usr/local/minio/data
#http://192.168.0.101/usr/local/minio/data1
#http://192.168.0.102/usr/local/minio/data
#http://192.168.0.102/usr/local/minio/data1

4、创建systemd文件

1
2
3
4
5
6
7
8
9
10
11
12
vim /usr/lib/systemd/system/minio.service
[Unit]
Description=Minio service
Documentation=https://docs.minio.io/

[Service]
WorkingDirectory=/usr/local/minio/
ExecStart=/usr/local/minio/bin/minioStart.sh
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target

5、修改权限并启动集群

1
2
3
4
chmod +x /usr/lib/systemd/system/minio.service && chmod +x /usr/local/minio/bin/minioStart.sh
systemctl daemon-reload
systemctl start minio
systemctl enable minio

6、将机器m1的操作在其余机器都执行一遍

三、访问

     192.168.0.100:9400

四、负载配置

1、安装nginx

2、vim  nginx.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
upstream http_minio {
server 192.168.0.100:9400;
server 192.168.0.101:9400;
server 192.168.0.102:9400;
}


server {
listen 9405;
server_name localhost;

#charset koi8-r;

#access_log logs/host.access.log main;

ignore_invalid_headers off;
client_max_body_size 0;
proxy_buffering off;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header Host $http_host;
proxy_connect_timeout 300;
proxy_http_version 1.1;
chunked_transfer_encoding off;
proxy_ignore_client_abort on;
proxy_pass http://http_minio;

}
  • 标题: minio分布式部署
  • 作者: heiu
  • 创建于 : 2021-05-01 23:20:46
  • 更新于 : 2024-05-30 22:34:00
  • 链接: https://blog.heiu.top/posts/d75b385f.html
  • 版权声明: 本文章采用 CC BY-NC-SA 4.0 进行许可。
评论
此页目录
minio分布式部署