docker-compose单体服务部署minio集群

搭建单机单服务

version: '2'
services:
   # 数据存储
   minio:
     image: minio/minio:RELEASE.2021-06-07T21-40-51Z
     container_name: intelligentremotepatrol_minio
     restart: always
     volumes:
       - ./data/AnalysisResult:/data
       - ./data/minio/minioconfig:/root/.minio
     ports:
       - "9000:9000"
     environment:
       MINIO_ACCESS_KEY: minioadmin
       MINIO_SECRET_KEY: minioadmin
       MINIO_PROMETHEUS_AUTH_TYPE: public
     command: server /data

 

docker-compose单体服务部署minio集群

#docker-compose.yaml
version: "3"

# starts 4 docker containers running minio server instances. Each
# minio server's web interface will be accessible on the host at port
# 9001 through 9004.
services:
    minio1:
        image: minio/minio:RELEASE.2021-06-07T21-40-51Z
        volumes:
            - ./data1-1:/data1
            - ./data1-2:/data2
        ports:
            - "9001:9000"
        environment:
            MINIO_ACCESS_KEY: minio
            MINIO_SECRET_KEY: adminhzs888
        command: server http://minio{1...4}/data{1...2}
        healthcheck:
            test: ["CMD", "curl", "-f", "http://0.0.0.0:9000/minio/health/live"]
            interval: 30s
            timeout: 20s
            retries: 3

    minio2:
        image: minio/minio:RELEASE.2021-06-07T21-40-51Z
        volumes:
            - ./data2-1:/data1
            - ./data2-2:/data2
        ports:
            - "9002:9000"
        environment:
            MINIO_ACCESS_KEY: minio
            MINIO_SECRET_KEY: adminhzs888
        command: server http://minio{1...4}/data{1...2}
        healthcheck:
            test: ["CMD", "curl", "-f", "http://0.0.0.0:9000/minio/health/live"]
            interval: 30s
            timeout: 20s
            retries: 3

    minio3:
        image: minio/minio:RELEASE.2021-06-07T21-40-51Z
        volumes:
            - ./data3-1:/data1
            - ./data3-2:/data2
        ports:
            - "9003:9000"
        environment:
            MINIO_ACCESS_KEY: minio
            MINIO_SECRET_KEY: adminhzs888
        command: server http://minio{1...4}/data{1...2}
        healthcheck:
            test: ["CMD", "curl", "-f", "http://0.0.0.0:9000/minio/health/live"]
            interval: 30s
            timeout: 20s
            retries: 3

    minio4:
        image: minio/minio:RELEASE.2021-06-07T21-40-51Z
        volumes:
            - ./data4-1:/data1
            - ./data4-2:/data2
        ports:
            - "9004:9000"
        environment:
            MINIO_ACCESS_KEY: minio
            MINIO_SECRET_KEY: adminhzs888
        command: server http://minio{1...4}/data{1...2}
        healthcheck:
            test: ["CMD", "curl", "-f", "http://0.0.0.0:9000/minio/health/live"]
            interval: 30s
            timeout: 20s
            retries: 3

## By default this config uses default local driver,
## For custom volumes replace with volume driver configuration.
volumes:
    data1-1:
    data1-2:
    data2-1:
    data2-2:
    data3-1:
    data3-2:
    data4-1:
    data4-2:

然后直接看结果

通过9001、02、03、04端口都能访问到minio 的服务
不管通过哪个端口创建盒子 或者是添加图片其他的都能访问到

 

 

posted on 2023-07-20 17:30  白码一号  阅读(1022)  评论(0编辑  收藏  举报