[ADMIN] Replication mode Master-Slave - maintenance question.

From: czezz <czezz(at)o2(dot)pl>
To: pgsql-admin(at)postgresql(dot)org <pgsql-admin(at)postgresql(dot)org>
Subject: [ADMIN] Replication mode Master-Slave - maintenance question.
Date: 2017-03-23 17:47:24
Message-ID: 29bce6296d5445849e08d9b07d2ed1ca@gwp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi, I have set my Postgres into replication mode Master-Slave and it works good. Though, I have some question about maintaining it. Let me start from the beginning. How I set it up (briefly): 1. Stand Alone postgres (future MASTER) has been set to archive data to: /datastore/WAL (archive_command = &#39;cp %p /datastore/WAL/%f &amp;&amp; gzip /datastore/WAL/%f &#39;) 2. I have shared /datastore/WAL over NFS 3. I prepared SLAVE machine and created initial database out of MASTER&#39;s WAL-archival (over NFS) by preparing following file:    $ vi /var/lib/pgsql/9.2/data/recove    restore_command = &#39;gunzip -c /datastore/WAL/%f &gt; %p&#39;    standby_mode = &#39;on&#39;    primary_conninfo = &#39;host=MASTER_IP_ port=5432 user=rep password=password&#39;    trigger_file = &#39;/var/lib/pgsql/MASTER.trigger 4. One last thing - I keep archive_mode = off on the SLAVE. The above works perfect. Now, here I need your help to understand what is happening in case following scenario. SCENARIO: I turn off SLAVE for some time (and MASTER receives a lot of new data) and later I turn SLAVE on. Is it true/correct: - SLAVE restores missing data/delta over NFS (from MASTER&#39;s archival). This is due to existing /var/lib/pgsql/9.2/data/recove and entry: restore_command = &#39;gunzip -c /datastore/WAL/%f &gt; %p&#39; - Once restore is done, SLAVE will keep replicate new data from MASTER (btw. it is SLAVE who request replication, correct?) Can anyone please confirm that my above assumption is correct and if not correct it? Best regards, czezz

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message John Scalia 2017-03-23 18:05:54 Re: [ADMIN] Replication mode Master-Slave - maintenance question.
Previous Message John Scalia 2017-03-23 16:51:51 Re: unable to find data folder postgres9.4