User Tools

Site Tools


how_to:postgresql_replication

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
how_to:postgresql_replication [2013/06/28 13:47] paulhow_to:postgresql_replication [2019/02/06 17:10] (current) – [PostgreSQL Replication] paul
Line 9: Line 9:
 Both the Master and Slave PCs should have VPOP3 installed into the same location (eg c:\vpop3 or d:\vpop3, etc), or settings relating to paths will not work if you have to fail over to the Slave PC. Alternatively, you could use the [[http://blog.pscs.co.uk/command-line-access-to-vpop3-settings/|Command Line Settings Tool]] to change the paths as part of your fail over procedure. Both the Master and Slave PCs should have VPOP3 installed into the same location (eg c:\vpop3 or d:\vpop3, etc), or settings relating to paths will not work if you have to fail over to the Slave PC. Alternatively, you could use the [[http://blog.pscs.co.uk/command-line-access-to-vpop3-settings/|Command Line Settings Tool]] to change the paths as part of your fail over procedure.
  
 +(We can help set this up database replication for you if you wish, but this will be chargeable - the current rate is £150 + VAT for a simple setup (ie replicating over a LAN with file sharing available between the two PCs). If you have a more complicated setup (eg replicating over the Internet) this can be more complex as it can involve configuring VPNs etc, so the cost may be greater)
 =====On the Master PC===== =====On the Master PC=====
   * In the VPOP3\pgsql\data folder, find the file **postgresql.conf** and edit it using Notepad or another text editor. At the bottom of the file add the lines:   * In the VPOP3\pgsql\data folder, find the file **postgresql.conf** and edit it using Notepad or another text editor. At the bottom of the file add the lines:
Line 14: Line 15:
   wal_level = hot_standby   wal_level = hot_standby
   archive_mode = on   archive_mode = on
-  archive_command = 'copy %p \\\\192.168.1.10\\pgsql\\db_replication'+  archive_command = 'copy %p \\\\192.168.1.10\\pgsql\\db_replication\\%f'
   max_wal_senders = 5   max_wal_senders = 5
   wal_keep_segments = 128   wal_keep_segments = 128
Line 51: Line 52:
   trigger_file = 'c:\\vpop3\\stopreplication.txt'   trigger_file = 'c:\\vpop3\\stopreplication.txt'
   restore_command = 'copy \\\\192.168.1.10\\pgsql\\db_replication\\%f %p'   restore_command = 'copy \\\\192.168.1.10\\pgsql\\db_replication\\%f %p'
-  archive_cleanup_command = 'pg_archivecleanup \\\\192.168.1.10\\pgsql\\db_replication %r'+  archive_cleanup_command = 'c:\\vpop3\\pgsql\\bin\\pg_archivecleanup \\\\192.168.1.10\\pgsql\\db_replication %r'
  
   * Start the VPOP3DB service on the Standby PC   * Start the VPOP3DB service on the Standby PC
how_to/postgresql_replication.1372423679.txt.gz · Last modified: 2018/11/14 10:44 (external edit)