Sep 7, 2021

Streaming Replication Step by step notes




  1. On master, changed listener to * in postgreSQL.congif
  2. Reboot master posstgres SQL
  3. Created login for replication on master

CREATE USER replicator WITH REPLICATION ENCRYPTED PASSWORD '******';

  1. Modify pg_hba.conf on master with slave info…

echo "host replication replicator 192.168.0.126/32 md5" >> pg_hba.conf \

/u01/app/postgres/bin/psql -c "select pg_reload_conf()"


  1. pg_basebackup make sure you take the backup from slave and PostgreSQL service must be in stop mode.

/u01/app/postgres/pgsql/bin/pg_basebackup -h 192.168.0.117 -U replicator -p 5432 -D /u05/pgsql/database -Fp -Xs -P -R




NOTE:-


In my case, I have installed PostgreSQL (PostgreSQL 12) in /u01/app/postgres/pgsql/bin/ directory and data directory  is /u05/pgsql/database 


No comments:

Post a Comment

If you have any doubt or question, please contact us.