Sign inSign up

polinux/postgres-bdr

By polinux

•Updated over 9 years ago

PostgreSQL with Bi-Directional Replication in a docker. (CentOS7+Supervisor)

Image
3

10K+

polinux/postgres-bdr repository overview

⁠PostgreSQL with BDR⁠ B-Directional Replication in a docker.

CircleCI Build Status GitHub Open Issues GitHub Stars GitHub Forks
Stars on Docker Hub Pulls on Docker Hub

Docker Image⁠ with PostgreSQL server with BDR⁠ support for database Bi-Directional replication. Based on CentOS with Supervisor⁠.

User can specify if database should work as stand-alone or master/slave mode. Even though BDR is more master/master solution we need to deploy first image which will create BDR setup inside of PostgreSQL. So for this purpose on run we need to specify one image to be so called master.

⁠Environmental Variables
VariableMeaning
POSTGRES_PASSWORDSelf explanatory
POSTGRES_USERSelf explanatory
POSTGRES_DBSelf explanatory
POSTGRES_PORTSelf explanatory
MODEMode in which this image shoudl work. Options: single/master/slave (default=single)
MASTER_ADDRESSAddress of master node
MASTER_PORTMaster node port
SLAVE_PORTSlave node port
⁠Usage
⁠Stand-Alone mode
docker run \
  -d \
  --name postgres \
  -p 5432:5432 \
  polinux/postgres-bdr
⁠Master + 2 slaves

Use docker-compose.yml exmple.

⁠Deploy all at once from docker-compose-yml file.
docker compose up

All

⁠Deploy master only
docker compose up master

Master

⁠Deploy slave1 only
docker compose up slave1

Master

⁠Deploy slave2 only
docker compose up slave2

Master

⁠Build
docker build -t polinux/postgres-bdr .

⁠Docker troubleshooting

Use docker command to see if all required containers are up and running:

$ docker ps

Check logs of postgres-bdr server container:

$ docker logs postgres-bdr

Sometimes you might just want to review how things are deployed inside a running container, you can do this by executing a bash shell through docker's exec command:

docker exec -ti postgres-bdr /bin/bash

History of an image and size of layers:

docker history --no-trunc=true polinux/postgres-bdr | tr -s ' ' | tail -n+2 | awk -F " ago " '{print $2}'

⁠Author

Przemyslaw Ozgo ([email protected]⁠)
This work is also inspired by agios⁠'s work on their docker images⁠. Many thanks!

Tag summary

Content type

Image

Digest

Size

86.2 MB

Last updated

over 9 years ago

docker pull polinux/postgres-bdr