Make Postgresql slave server in a minutes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Vladimir Smagin a7b72852b1 Изменить 'docker-entrypoint.sh' 11 months ago
Dockerfile Изменить 'Dockerfile' 11 months ago
docker-entrypoint.sh Изменить 'docker-entrypoint.sh' 11 months ago
image-build.sh import 11 months ago
image-run.sh import 11 months ago
readme.md Изменить 'readme.md' 11 months ago

readme.md

Postgres easy slave

Easy deploying slave server of Postgresql

Run on master server:

Do not forget replace 0.0.0.0 to IP of your slave server!

 $> echo "host replication all 0.0.0.0/0 md5" >> "/etc/postgresql/10/main/pg_hba.conf"
 $> su postgres
 $> psql -c "CREATE USER replicate REPLICATION LOGIN CONNECTION LIMIT 100 ENCRYPTED PASSWORD 'Myub3rpAssw0rd';" -U postgres

Run on slave server:

Build image

 $> docker build -t postgres-easy-slave .

Now you ready to run image

 $> docker run -d --name pg-slave-server \
    -e PG_REP_USER=replicate \
    -e PG_REP_PASSWORD=Myub3rpAssw0rd \
    -e PG_MASTER=pg-master-server.com \
    -e PG_MASTER_PORT=5433 \
    -p 5433:5432 \
    --restart=always postgres-easy-slave

That’s all!