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 Изменить '' 11 months ago
Dockerfile Изменить 'Dockerfile' 11 months ago Изменить '' 11 months ago import 11 months ago import 11 months ago Изменить '' 11 months ago

Postgres easy slave

Easy deploying slave server of Postgresql

Run on master server:

Do not forget replace to IP of your slave server!

 $> echo "host replication all 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 \
    -e PG_MASTER_PORT=5433 \
    -p 5433:5432 \
    --restart=always postgres-easy-slave

That’s all!