From: czezz <czezz@o2.pl>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: [ADMIN] Replication mode Master-Slave - maintenance question.
Date: Thu, 23 Mar 2017 18:47:24 +0100
Message-ID: <29bce6296d5445849e08d9b07d2ed1ca@gwp> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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 = 'cp %p /datastore/WAL/%f && gzip /datastore/WAL/%f ') 2. I have shared /datastore/WAL over NFS 3. I prepared SLAVE machine and created initial database out of MASTER's WAL-archival (over NFS) by preparing following file: $ vi /var/lib/pgsql/9.2/data/recove restore_command = 'gunzip -c /datastore/WAL/%f > %p' standby_mode = 'on' primary_conninfo = 'host=MASTER_IP_ port=5432 user=rep password=password' trigger_file = '/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's archival). This is due to existing /var/lib/pgsql/9.2/data/recove and entry: restore_command = 'gunzip -c /datastore/WAL/%f > %p' - 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: czezz@o2.pl
Subject: Re: [ADMIN] Replication mode Master-Slave - maintenance question.
In-Reply-To: <29bce6296d5445849e08d9b07d2ed1ca@gwp>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox