minio 集群搭建
具体实际的取舍可以参考官方文档,我使用的是4 node 4 driver 模式
环境机器说明
192.168.31.2 192.168.31.3 192.168.31.4 192.168.31.5
每台机器单独挂在4块盘 data1 data2 data3 data4
minio 安装包参考github 网站
参考图
启动&&运行
- 配置key(实际可以直接配置到profile中)
export MINIO_ACCESS_KEY=<ACCESS_KEY>
export MINIO_SECRET_KEY=<SECRET_KEY>
- 启动(每台机器执行)
/usr/local/bin/minio server http://192.168.31.2/data1 http://192.168.31.2/data2 \
http://192.168.31.2/data3 http://192.168.31.2/data4 \
http://192.168.31.3/data1 http://192.168.31.3/data2 \
http://192.168.31.3/data3 http://192.168.31.3/data4 \
http://192.168.31.4/data1 http://192.168.31.4/data2 \
http://192.168.31.4/data3 http://192.168.31.4/data4 \
http://192.168.31.5/data1 http://192.168.31.5/data2 \
http://192.168.31.5/data3 http://192.168.31.5/data4
等待片刻,节点加入成功,并会格式化磁盘
配置nginx 支持lb
我使用了lvs nginx 是在realserver 上,并使用了dr 模式
upstream minio {
server 192.168.31.2:9000 weight=10 max_fails=2 fail_timeout=30s;
server 192.168.31.3:9000 weight=10 max_fails=2 fail_timeout=30s;
server 192.168.31.4:9000 weight=10 max_fails=2 fail_timeout=30s;
server 192.168.31.5:9000 weight=10 max_fails=2 fail_timeout=30s;
}
server {
listen 9000;
server_name localhost;
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;
}
}
访问测试
说明
实际使用可能需要使用systemd 进行管理,官方提供了脚本
- 参考脚本
[Unit]
Description=Minio
Documentation=https://docs.minio.io
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/usr/local/bin/minio
[Service]
WorkingDirectory=/usr/local
User=minio-user
Group=minio-user
PermissionsStartOnly=true
EnvironmentFile=-/etc/default/minio
ExecStartPre=/bin/bash -c "[ -n \"${MINIO_VOLUMES}\" ] || echo \"Variable MINIO_VOLUMES not set in /etc/defaults/minio\""
ExecStart=/usr/local/bin/minio server $MINIO_OPTS $MINIO_VOLUMES
# Let systemd restart this service only if it has ended with the clean exit code or signal.
Restart=on-success
StandardOutput=journal
StandardError=inherit
# Specifies the maximum file descriptor number that can be opened by this process
LimitNOFILE=65536
# Disable timeout logic and wait until process is stopped
TimeoutStopSec=0
# SIGTERM signal is used to stop Minio
KillSignal=SIGTERM
SendSIGKILL=no
SuccessExitStatus=0
[Install]
WantedBy=multi-user.target
# Built for ${project.name}-${project.version} (${project.name})
参考资料
https://docs.minio.io/docs/distributed-minio-quickstart-guide
https://github.com/minio/minio-service
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 一个奇形怪状的面试题:Bean中的CHM要不要加volatile?
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· .NET Core 托管堆内存泄露/CPU异常的常见思路
· PostgreSQL 和 SQL Server 在统计信息维护中的关键差异
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· 上周热点回顾(2.17-2.23)
· 如何使用 Uni-app 实现视频聊天(源码,支持安卓、iOS)
· spring官宣接入deepseek,真的太香了~
2017-06-19 openresty 使用 log_by_lua 发送日志到 syslog-ng
2017-06-19 uuid 了解
2017-06-19 基于openresty 的几个开发框架
2016-06-19 apache mesos 安装