Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 923 Bytes

README.md

File metadata and controls

39 lines (27 loc) · 923 Bytes

Docker

Restarting container

pg_ctl: cannot be run as root

docker restart

Replacing pg_hba.conf content

docker cp db01:/var/lib/postgresql/data/pg_hba.conf .
cp pg_hba.conf pg_hba.backup.conf

vim pg_hba.conf
host    replication     replication_user 172.19.0.3/32               md5

docker cp pg_hba.conf db01:/var/lib/postgresql/data/.

docker restart db01

Standby process

  1. Create replication slot
  2. Create pg_hba.conf entries for replication_user. Use the IP address from db02 and db03 /32 version (IPv4)
  3. Make sure there is a standby.signal file
  4. Restart it (should restart in recovery mode)

Docker permissions

  • Run chown and chmod on the .pgpass file
  • Use the postgres user
docker exec --user root -it db02 chown postgres:root /var/lib/postgresql/.pgpass
docker exec --user root -it db02 chmod 0600 /var/lib/postgresql/.pgpass