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