minio

四节点 x 四盘位的高可用多节点多盘 MinIO 集群演示

minio 配置模板演示了如何部署一套四节点 x 四盘位、总计十六盘的高可用 MinIO 集群,提供 S3 兼容的对象存储服务。

更多教程,请参考 MINIO 模块文档。


配置概览

  • 配置名称: minio(位于 demo/minio.yml
  • 节点数量: 四节点
  • 配置说明:高可用多节点多盘 MinIO 集群演示
  • 适用系统:el8, el9, d12, u22, u24
  • 适用架构:x86_64, aarch64
  • 相关配置:meta

启用方式:

./configure -c demo/minio

备注:这是一个四节点模版,您需要在生成配置后修改其他三个节点的 IP 地址


配置内容

源文件地址:pigsty/conf/demo/minio.yml

all:
  children:

    # infra cluster for proxy, monitor, alert, etc..
    infra: { hosts: { 10.10.10.10: { infra_seq: 1 } } }

    # minio cluster with 4 nodes and 4 drivers per node
    minio:
      hosts:
        10.10.10.10: { minio_seq: 1 , nodename: minio-1 }
        10.10.10.11: { minio_seq: 2 , nodename: minio-2 }
        10.10.10.12: { minio_seq: 3 , nodename: minio-3 }
        10.10.10.13: { minio_seq: 4 , nodename: minio-4 }
      vars:
        minio_cluster: minio
        minio_data: '/data{1...4}'          # 每节点4盘
        minio_buckets:                      # 创建存储桶
          - { name: pgsql }
          - { name: meta ,versioning: true }
          - { name: data }
        minio_users:                        # 创建用户
          - { access_key: pgbackrest  ,secret_key: S3User.Backup ,policy: pgsql }
          - { access_key: s3user_meta ,secret_key: S3User.Meta   ,policy: meta  }
          - { access_key: s3user_data ,secret_key: S3User.Data   ,policy: data  }

        # 绑定 L2 VIP (10.10.10.9) 到 minio 集群(可选)
        node_cluster: minio
        vip_enabled: true
        vip_vrid: 128
        vip_address: 10.10.10.9
        vip_interface: eth1

        # 在所有节点上通过 HAProxy 暴露 MinIO 服务
        haproxy_services:
          - name: minio
            port: 9002
            balance: leastconn
            options:
              - option httpchk
              - option http-keep-alive
              - http-check send meth OPTIONS uri /minio/health/live
              - http-check expect status 200
            servers:
              - { name: minio-1 ,ip: 10.10.10.10 ,port: 9000 ,options: 'check-ssl ca-file /etc/pki/ca.crt check port 9000' }
              - { name: minio-2 ,ip: 10.10.10.11 ,port: 9000 ,options: 'check-ssl ca-file /etc/pki/ca.crt check port 9000' }
              - { name: minio-3 ,ip: 10.10.10.12 ,port: 9000 ,options: 'check-ssl ca-file /etc/pki/ca.crt check port 9000' }
              - { name: minio-4 ,ip: 10.10.10.13 ,port: 9000 ,options: 'check-ssl ca-file /etc/pki/ca.crt check port 9000' }

  vars:
    version: v4.0.0
    admin_ip: 10.10.10.10
    region: default
    infra_portal:
      home : { domain: i.pigsty }
      # 每个 MinIO 节点的控制台访问域名
      minio   : { domain: m.pigsty   ,endpoint: "10.10.10.10:9001" ,scheme: https ,websocket: true }
      minio10 : { domain: m10.pigsty ,endpoint: "10.10.10.10:9001" ,scheme: https ,websocket: true }
      minio11 : { domain: m11.pigsty ,endpoint: "10.10.10.11:9001" ,scheme: https ,websocket: true }
      minio12 : { domain: m12.pigsty ,endpoint: "10.10.10.12:9001" ,scheme: https ,websocket: true }
      minio13 : { domain: m13.pigsty ,endpoint: "10.10.10.13:9001" ,scheme: https ,websocket: true }

    minio_endpoint: https://sss.pigsty:9002   # 使用 HAProxy 负载均衡端点
    node_etc_hosts: ["10.10.10.9 sss.pigsty"] # VIP 域名解析

    #----------------------------------------------#
    # PASSWORD
    #----------------------------------------------#
    grafana_admin_password: pigsty
    haproxy_admin_password: pigsty
    minio_secret_key: S3User.MinIO

配置解读

minio 模板是 MinIO 生产级部署的参考配置,展示了多节点多盘 (MNMD) 架构。

关键特性

  • 多节点多盘架构:4 节点 × 4 盘 = 16 盘纠删码组
  • L2 VIP 高可用:通过 Keepalived 绑定虚拟 IP
  • HAProxy 负载均衡:9002 端口统一访问入口
  • 细粒度权限:为不同应用创建独立用户和存储桶

访问方式

# 使用 mcli 配置 MinIO 别名(通过 HAProxy 负载均衡)
mcli alias set sss https://sss.pigsty:9002 minioadmin S3User.MinIO

# 列出存储桶
mcli ls sss/

# 使用控制台
# 访问 https://m.pigsty 或 https://m10-m13.pigsty

适用场景

  • 需要 S3 兼容对象存储的环境
  • PostgreSQL 备份存储(pgBackRest 远程仓库)
  • 大数据和 AI 工作负载的数据湖
  • 需要高可用对象存储的生产环境

注意事项

  • 每个节点需要准备 4 块独立磁盘挂载到 /data1 - /data4
  • 生产环境建议至少 4 节点以实现纠删码冗余
  • VIP 需要正确配置网络接口(vip_interface
  • 节点间需要能够互相解析 minio-{1...4}.pigsty 域名

最后修改 2025-12-20: a big refactor (cf41ad2)