Skip to content

Conversation

@costela
Copy link

@costela costela commented Nov 15, 2017

This patch adds support for simple unintrusive master/slave setup.
It makes no changes for the single-node use-case, but adds two new environment variables: POSTGRES_NUM_SLAVES and POSTGRES_MASTER_HOST.
These enables the following simple scenario (as a docker-compose example):

version: '3.1'

services:
  pgmaster:
    image: postgres
    environment:
      POSTGRES_NUM_SLAVES: 1

  pgslave:
    image: postgres
    depends_on:
      - pgmaster
    restart: always
    environment:
      POSTGRES_MASTER_HOST: pgmaster

refs #55, #88, #104

@higgsmass
Copy link

This is an excellent support to have and works perfectly out of the box.
Thanks!
Venkat

@dwickern
Copy link

👍 It would be great to have this

@tianon
Copy link
Member

tianon commented Dec 21, 2017

While the idea seems good, I'm not entirely sold on the complexity this adds to the official image, and think this use case would be better served by a derivative image (since it would only be a new entrypoint, and as such would be pretty easy to keep in sync with the official image given automated builds and repository links).

This patch adds support for  simple unintrusive master/slave setup.
It makes no changes for the single-node use-case, but adds two new environment variables: `POSTGRES_NUM_SLAVES` and `POSTGRES_MASTER_HOST`.
These enables the following simple scenario:

```
version: '3.1'

services:
  pgmaster:
    image: postgres
    environment:
      POSTGRES_NUM_SLAVES: 1

  pgslave:
    image: postgres
    depends_on:
      - pgmaster
    restart: always
    environment:
      POSTGRES_MASTER_HOST: pgmaster
```

refs docker-library#55, docker-library#88, docker-library#104
@yosifkit
Copy link
Member

Closing old issue.

@yosifkit yosifkit closed this Sep 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants