There are multiple possibilities for running MinIO within a container e.g. configurable address, non-root user etc. This makes it difficult to identify actual IP / Port to use to check healthcheck status from within a container. It is simpler to use external healthcheck mechanisms like healthcheck command in docker-compose to check for MinIO health status. This is similar to how checks work in Kubernetes as well. This PR removes the healthcheck script used inside Docker container and ad documentation on how to use docker-compose based healthcheck mechanism.
133 lines
2.9 KiB
YAML
133 lines
2.9 KiB
YAML
version: '3.7'
|
|
|
|
services:
|
|
minio1:
|
|
image: minio/minio:RELEASE.2019-08-14T20-37-41Z
|
|
hostname: minio1
|
|
volumes:
|
|
- minio1-data:/export
|
|
ports:
|
|
- "9001:9000"
|
|
networks:
|
|
- minio_distributed
|
|
deploy:
|
|
restart_policy:
|
|
delay: 10s
|
|
max_attempts: 10
|
|
window: 60s
|
|
placement:
|
|
constraints:
|
|
- node.labels.minio1==true
|
|
command: server http://minio1/export http://minio2/export http://minio3/export http://minio4/export
|
|
secrets:
|
|
- secret_key
|
|
- access_key
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://minio1:9000/minio/health/live"]
|
|
interval: 1m30s
|
|
timeout: 20s
|
|
retries: 3
|
|
start_period: 3m
|
|
|
|
minio2:
|
|
image: minio/minio:RELEASE.2019-08-14T20-37-41Z
|
|
hostname: minio2
|
|
volumes:
|
|
- minio2-data:/export
|
|
ports:
|
|
- "9002:9000"
|
|
networks:
|
|
- minio_distributed
|
|
deploy:
|
|
restart_policy:
|
|
delay: 10s
|
|
max_attempts: 10
|
|
window: 60s
|
|
placement:
|
|
constraints:
|
|
- node.labels.minio2==true
|
|
command: server http://minio1/export http://minio2/export http://minio3/export http://minio4/export
|
|
secrets:
|
|
- secret_key
|
|
- access_key
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://minio2:9000/minio/health/live"]
|
|
interval: 1m30s
|
|
timeout: 20s
|
|
retries: 3
|
|
start_period: 3m
|
|
|
|
minio3:
|
|
image: minio/minio:RELEASE.2019-08-14T20-37-41Z
|
|
hostname: minio3
|
|
volumes:
|
|
- minio3-data:/export
|
|
ports:
|
|
- "9003:9000"
|
|
networks:
|
|
- minio_distributed
|
|
deploy:
|
|
restart_policy:
|
|
delay: 10s
|
|
max_attempts: 10
|
|
window: 60s
|
|
placement:
|
|
constraints:
|
|
- node.labels.minio3==true
|
|
command: server http://minio1/export http://minio2/export http://minio3/export http://minio4/export
|
|
secrets:
|
|
- secret_key
|
|
- access_key
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://minio3:9000/minio/health/live"]
|
|
interval: 1m30s
|
|
timeout: 20s
|
|
retries: 3
|
|
start_period: 3m
|
|
|
|
minio4:
|
|
image: minio/minio:RELEASE.2019-08-14T20-37-41Z
|
|
hostname: minio4
|
|
volumes:
|
|
- minio4-data:/export
|
|
ports:
|
|
- "9004:9000"
|
|
networks:
|
|
- minio_distributed
|
|
deploy:
|
|
restart_policy:
|
|
delay: 10s
|
|
max_attempts: 10
|
|
window: 60s
|
|
placement:
|
|
constraints:
|
|
- node.labels.minio4==true
|
|
command: server http://minio1/export http://minio2/export http://minio3/export http://minio4/export
|
|
secrets:
|
|
- secret_key
|
|
- access_key
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://minio4:9000/minio/health/live"]
|
|
interval: 1m30s
|
|
timeout: 20s
|
|
retries: 3
|
|
start_period: 3m
|
|
|
|
volumes:
|
|
minio1-data:
|
|
|
|
minio2-data:
|
|
|
|
minio3-data:
|
|
|
|
minio4-data:
|
|
|
|
networks:
|
|
minio_distributed:
|
|
driver: overlay
|
|
|
|
secrets:
|
|
secret_key:
|
|
external: true
|
|
access_key:
|
|
external: true
|