155 lines
4.4 KiB
YAML
155 lines
4.4 KiB
YAML
version: "3.7"
|
|
|
|
networks:
|
|
mother:
|
|
external: true
|
|
|
|
services:
|
|
pg-0:
|
|
image: registry.vnfco.ir/library/bitnami/postgresql-repmgr:13.5.0-debian-10-r48
|
|
environment:
|
|
- REPMGR_PARTNER_NODES=pg-0,pg-1
|
|
- REPMGR_NODE_NAME=pg-0
|
|
- REPMGR_NODE_NETWORK_NAME=pg-0
|
|
- REPMGR_PRIMARY_HOST=pg-0
|
|
- REPMGR_PASSWORD=UjvGvyYXZZTvL1GsST7AJrtmQjqSV+LOihKQaEGyUUtdQAUGSA3BsFEi5B4KoRBF
|
|
- POSTGRESQL_PASSWORD=xHTpBf4wC+bBeNg2pL6Ga7VEWKFJx7VPEUpqxwPFfOc2YYTVwFQuHfsiqoVeT9+6
|
|
volumes:
|
|
- /Users/amirmoghi3/volume/pg/pg_0_data:/bitnami/postgresql
|
|
ports:
|
|
- "5432:5432"
|
|
networks:
|
|
- mother
|
|
deploy:
|
|
placement:
|
|
constraints:
|
|
- node.role == worker
|
|
resources:
|
|
limits:
|
|
cpus: "1"
|
|
memory: 300M
|
|
update_config:
|
|
parallelism: 1
|
|
delay: 10s
|
|
order: stop-first
|
|
restart_policy:
|
|
condition: any
|
|
delay: 5s
|
|
max_attempts: 3
|
|
window: 120s
|
|
healthcheck:
|
|
test: ["CMD", "curl", "--fail", "--silent", "--output", "/dev/null", "--write-out", "HTTPSTATUS:%{http_code}", "http://localhost:5432/"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 5s
|
|
|
|
pg-1:
|
|
image: registry.vnfco.ir/library/bitnami/postgresql-repmgr:13.5.0-debian-10-r48
|
|
environment:
|
|
- REPMGR_PARTNER_NODES=pg-0,pg-1
|
|
- REPMGR_NODE_NAME=pg-1
|
|
- REPMGR_NODE_NETWORK_NAME=pg-1
|
|
- REPMGR_PRIMARY_HOST=pg-0
|
|
- REPMGR_PASSWORD=UjvGvyYXZZTvL1GsST7AJrtmQjqSV+LOihKQaEGyUUtdQAUGSA3BsFEi5B4KoRBF
|
|
- POSTGRESQL_PASSWORD=xHTpBf4wC+bBeNg2pL6Ga7VEWKFJx7VPEUpqxwPFfOc2YYTVwFQuHfsiqoVeT9+6
|
|
volumes:
|
|
- /Users/amirmoghi3/volume/pg/pg_1_data:/bitnami/postgresql
|
|
ports:
|
|
- "5433:5432"
|
|
networks:
|
|
- mother
|
|
deploy:
|
|
placement:
|
|
constraints:
|
|
|
|
- node.role == worker
|
|
resources:
|
|
limits:
|
|
cpus: "0.5"
|
|
memory: 300M
|
|
update_config:
|
|
parallelism: 1
|
|
delay: 10s
|
|
order: start-first
|
|
restart_policy:
|
|
condition: any
|
|
delay: 5s
|
|
max_attempts: 3
|
|
window: 120s
|
|
healthcheck:
|
|
test: ["CMD", "curl", "--fail", "--silent", "--output", "/dev/null", "--write-out", "HTTPSTATUS:%{http_code}", "http://localhost:5432/"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 5s
|
|
|
|
# pgmaster:
|
|
# image: registry.vnfco.ir/library/crunchydata/crunchy-postgres:centos7-13.1-4.5.1
|
|
# volumes:
|
|
# - '/Users/amirmoghi3/volume/pg:/bitnami/postgresql'
|
|
# environment:
|
|
# - POSTGRESQL_USERNAME=igarsonAgent
|
|
# - POSTGRESQL_PASSWORD=xHTpBf4wC+bBeNg2pL6Ga7VEWKFJx7VPEUpqxwPFfOc2YYTVwFQuHfsiqoVeT9+6
|
|
# - POSTGRESQL_DATABASE=igarsonDB
|
|
# - POSTGRESQL_REPLICATION_MODE=master
|
|
# - POSTGRESQL_REPLICATION_USER=pgreplicator
|
|
# - POSTGRESQL_REPLICATION_PASSWORD=ciXz6xmnEMZSO+0T8L6mGcFJrAvPzkTC04oh/WYIRi51gMQLPfW8tTEHALX6fhk4
|
|
# deploy:
|
|
# update_config:
|
|
# parallelism: 1
|
|
# delay: 10s
|
|
# order: start-first
|
|
# restart_policy:
|
|
# condition: any
|
|
# delay: 5s
|
|
# max_attempts: 3
|
|
# window: 120s
|
|
# resources:
|
|
# limits:
|
|
# cpus: '1'
|
|
# memory: 300M
|
|
# replicas: 1
|
|
# mode: replicated
|
|
# placement:
|
|
# constraints:
|
|
# - node.role == worker
|
|
# ports:
|
|
# - "5432:5432"
|
|
# networks:
|
|
# - mother
|
|
|
|
# pgslave:
|
|
# image: registry.vnfco.ir/library/crunchydata/crunchy-postgres:centos7-13.1-4.5.1
|
|
# environment:
|
|
# - POSTGRESQL_REPLICATION_MODE=slave
|
|
# - POSTGRESQL_REPLICATION_USER=pgreplicator
|
|
# - POSTGRESQL_REPLICATION_PASSWORD=ciXz6xmnEMZSO+0T8L6mGcFJrAvPzkTC04oh/WYIRi51gMQLPfW8tTEHALX6fhk4
|
|
# - POSTGRESQL_MASTER_HOST=pgmaster
|
|
# - POSTGRESQL_PASSWORD=xHTpBf4wC+bBeNg2pL6Ga7VEWKFJx7VPEUpqxwPFfOc2YYTVwFQuHfsiqoVeT9+6
|
|
# - POSTGRESQL_MASTER_PORT_NUMBER=5432
|
|
|
|
# deploy:
|
|
# update_config:
|
|
# parallelism: 1
|
|
# delay: 10s
|
|
# order: start-first
|
|
# restart_policy:
|
|
# condition: any
|
|
# delay: 5s
|
|
# max_attempts: 3
|
|
# window: 120s
|
|
# resources:
|
|
# limits:
|
|
# cpus: '0.7'
|
|
# memory: 300M
|
|
# mode: replicated
|
|
# replicas: 1
|
|
# placement:
|
|
# constraints:
|
|
# - node.role == worker
|
|
# ports:
|
|
# - "5433:5432"
|
|
# networks:
|
|
# - mother
|