Tuesday 28 February 2017

Configure Postgres Hot Standby Server Using Log Shipping::

 Configure Postgres Hot Standby Server Using Log Shipping::
=============================================

Configure two identical database server machines. My version is (PostgreSQL) 9.6.2. Differences in database version can cause conflicts during log shipping.

Server 1 -  dbmaster.local - 192.168.1.1
Server 2 -  dbslave.local   - 192.168.1.2

* Created the user postgres on both machines.
* Enabled ssh key authentication for postgres user

Master configuration::
 
Edit postgresql.conf

wal_level = hotstandby
archive_mode = on
archive_command = 'scp  %p  postgres@dbslave.local:archive_logs/archive%f '

listen_addresses = '*'
archive_timeout = 120
max_wal_senders =1

Edit pg_hba.conf
host     all                      all             192.168.1.0/24        trust
host     replication     rep            192.168.1.2/24        trust

No comments:

Post a Comment