|
2 years ago | |
---|---|---|
Dockerfile | 2 years ago | |
docker-entrypoint.sh | 2 years ago | |
image-build.sh | 2 years ago | |
image-run.sh | 2 years ago | |
readme.md | 2 years ago |
Easy deploying slave server of Postgresql
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
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!