Skip to content

Instantly share code, notes, and snippets.

@mavencode01
Created January 27, 2016 08:01
Show Gist options
  • Save mavencode01/13789389a45ee9ec9d5e to your computer and use it in GitHub Desktop.
Save mavencode01/13789389a45ee9ec9d5e to your computer and use it in GitHub Desktop.
postgres replicated
psql-master:
image: 'sameersbn/postgresql:9.4-4'
deployment_strategy: emptiest_node
environment:
- DB_NAME=gitlabhq_production
- DB_PASS=password
- DB_USER=gitlab
- PSQL_MODE=replicator
- PSQL_TRUST_LOCALNET=true
- REPLICATION_USER=replicator
- REPLICATION_PASS=replicatorpass
-
tags:
- production
- ops
- db
volumes:
- /opt/postgresql/data:/var/lib/postgresql
psql-slave:
image: 'sameersbn/postgresql:9.4-4'
deployment_strategy: high_availability
environment:
- DB_NAME=gitlabhq_production
- DB_PASS=password
- DB_USER=gitlab
- PSQL_MODE=slave
- PSQL_TRUST_LOCALNET=true
- REPLICATION_HOST=psql-master
- REPLICATION_USER=replicator
- REPLICATION_PASS=replicatorpass
- REPLICATION_PORT=5432
links:
- psql-master
tags:
- production
- ops
- db-slave
volumes:
- /opt/postgresql/data:/var/lib/postgresql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment