Minio多主机分布式 docker-compose 集群部署
以下是一个使用docker-compose部署Minio多主机分布式集群的示例。确保你有足够的机器和网络权限来运行这些容器。
- 创建一个名为
docker-compose.yml
的文件,内容如下:
version: '3'
services:
minio1:
image: minio/minio:RELEASE.2021-06-09T00-08-28Z
volumes:
- data1-1:/data
- data1-2:/data
environment:
MINIO_ACCESS_KEY: your-access-key
MINIO_SECRET_KEY: your-secret-key
MINIO_SERVERS: "4"
command: server http://minio1/data1-1 http://minio2/data1-2 http://minio3/data1-3 http://minio4/data1-4
ports:
- "9000:9000"
- "9001:9001"
restart: always
networks:
- minio-net
minio2:
image: minio/minio:RELEASE.2021-06-09T00-08-28Z
volumes:
- data2-1:/data
- data2-2:/data
environment:
MINIO_ACCESS_KEY: your-access-key
MINIO_SECRET_KEY: your-secret-key
MINIO_SERVERS: "4"
command: server http://minio1/data1-1 http://minio2/data2-1 http://minio3/data2-3 http://minio4/data2-4
ports:
- "9002:9000"
- "9003:9001"
restart: always
networks:
- minio-net
minio3:
image: minio/minio:RELEASE.2021-06-09T00-08-28Z
volumes:
- data3-1:/data
- data3-2:/data
environment:
MINIO_ACCESS_KEY: your-access-key
MINIO_SECRET_KEY: your-secret-key
MINIO_SERVERS: "4"
command: server http://minio1/data1-1 http://minio2/data2-1 http://minio3/data3-1 http://minio4/data3-4
ports:
- "9004:9000"
- "9005:9001"
restart: always
networks:
- minio-net
minio4:
image: minio/minio:RELEASE.2021-06-09T00-08-28Z
volumes:
- data4-1:/data
- data4-2:/data
environment:
MINIO_ACCESS_KEY: your-access-key
MINIO_SECRET_KEY: your-secret-key
MINIO_SERVERS: "4"
command: server http://minio1/data1-1 http://minio2/data2-1 http://minio3/data3-1 http://minio4/data4-1
ports:
- "9006:9000"
- "9007:9001"
restart: always
networks:
- minio-net
volumes:
data1-1:
data1-2:
data2-1:
data2-2:
data3-1:
data3-2:
data4-1:
data4-2:
networks:
minio-net:
driver: bridge
- 在命令行中运行
docker-compose up -d
来启动集群。
请确保替换 your-access-key
和
评论已关闭