一覧へ戻る
Postgres streaming replication with Docker containers
- star 数
- 37
- watcher 数
- 3
- fork 数
- 26
- issue 数
- 4
- 最終更新
- 2021/05/27
Postgres streaming replication with Docker containers
Enhanced version of the official Postgres image to support streaming replication out of the box.
Postgres-replication is meant to be used with orchestration systems such as Kubernetes.
Images are automatically updated when the official postgres image is updated.
Supported tags:
docker-compose up
To run with Docker, first run the Postgres master:
docker run -p 127.0.0.1:5432:5432 --name postgres-master nebirhos/postgres-replication
Then Postgres slave(s):
docker run -p 127.0.0.1:5433:5432 --link postgres-master \
-e POSTGRES_MASTER_SERVICE_HOST=postgres-master \
-e REPLICATION_ROLE=slave \
-t nebirhos/postgres-replication
Replication is set up at container start by putting scripts in the /docker-entrypoint-initdb.d folder.
This way the original Postgres image scripts are left untouched.
See Dockerfile and official Postgres image for custom environment variables.