Docker Swarm 使用NFS 搭建 S3 (minio)多副本

使用Docker Swarm 搭建S3(minio )每个节点启动一个副本

安装docker

请参考官方文档

或CentOS版本 CentOS 快速安装docker

初始化docker Swarm

请参考官方文档

或参考 安装docker 后初始化 swarm

确保 NFS 正常工作

NFS 服务 地址 10.0.2.100:/harbor_nas

配置文件 docker-minio-compose.yml

启动命令 docker stack deploy -c docker-minio-compose.yml --with-registry-auth minio

version: '3.7'
services:
  minio:
    image: minio/minio:RELEASE.2020-03-19T21-49-00Z
    hostname: minio
    environment:
      - TZ=Asia/Shanghai # 设置容器时区与宿主机保持一致
      - MINIO_ACCESS_KEY=minioadmin
      - MINIO_SECRET_KEY=minioadmin
    volumes:
      - harbor_nas:/data
    ports:
      - "9000:9000"
    networks:
      - minio_distributed
    deploy:
      mode: global
      restart_policy:
        delay: 10s
        max_attempts: 10
        window: 60s
    command: server /data
volumes:
  harbor_nas:
    driver: local
    driver_opts:
      type: "nfs"
      o: "addr=10.0.28.100,vers=4,rw"
      device: ":/harbor_nas"
networks:
  minio-network:
    driver: overlay

你可能感兴趣的:(Docker Swarm 使用NFS 搭建 S3 (minio)多副本)