Re: [GENERAL] archive_command not being executed

Поиск
Список
Период
Сортировка
От Eric D
Тема Re: [GENERAL] archive_command not being executed
Дата
Msg-id MWHPR12MB19336044317087CEBE61ED49BF290@MWHPR12MB1933.namprd12.prod.outlook.com
обсуждение исходный текст
Ответ на Re: [GENERAL] archive_command not being executed  (Jeremy Schneider <schneider@ardentperf.com>)
Список pgsql-general

Hi Jeremy, 


Thanks for the info on 9.3 vs 9.5.  While searching for Paul's suggestion I'd seen the same thing, but didn't "reply all" so my response didn't make it into the mailing list. 


Regarding your question, as I understand the process, you need to get the WAL files being shipped over to the standby before you start streaming replication.  The sequence of events I think is supposed to happen is:


  1. Start WAL file shipping from master->standby
  2. Run pg_basebackup from master->standby
  3. With a recovery.conf in place, start the standby.  The recovery.conf needs the connection info for the master for the streaming replication, but it also needs the location of the WAL files, to replay what's been going on during the pg_basebackup.  

I don't think streaming replication has a way to pick up the activity covered in the WAL files.




From: Jeremy Schneider <schneider@ardentperf.com>
Sent: Monday, November 13, 2017 3:56 PM
To: ericd81@hotmail.com
Cc: PostgreSQL General; Paul Jungwirth
Subject: Re: [GENERAL] archive_command not being executed
 
Hi Eric,

Thanks for using PostgreSQL!

On Fri, Nov 10, 2017 at 9:26 AM, Paul Jungwirth
<pj@illuminatedcomputing.com> wrote:
> Oh this has happened to me before. :-) On SB1 you need to set
> archive_mode to always (not on). Otherwise it is ignored when running as a
> standby.

It looks to me like this feature was not added until 9.5 and Eric is
running 9.3  :(

> On 11/10/2017 09:10 AM, Eric D wrote:
>> I have a standby db server (SB1) that will soon become the master.  SB1
>> is set up with streaming replication from the current master.  I'm
>> trying to set up a third server (SB2) as a slave/standby to SB1, so that
>> when SB1 becomes the master, there will be a standby for it.  First step
>> is to get WAL files shipped from SB1->SB2.

Eric,

From my reading of the docs and commit logs, standby databases
couldn't archive their WALs until 9.5.

https://www.postgresql.org/message-id/CANkGpBs7qgAkgQ-OPZY0EsaM6+WUE5MgpyeHCGo_eOQ7tJVyyg@mail.gmail.com
http://paquier.xyz/postgresql-2/postgres-9-5-feature-highlight-archive-mode-always/



There is a section in the 9.3 docs about cascading replication:
https://www.postgresql.org/docs/9.3/static/warm-standby.html#CASCADING-REPLICATION



It seems to me this is based on streaming replication only.  Looks
like it's not designed (in 9.3) to start archiving until it becomes a
primary.  "You will also need to set primary_conninfo in the
downstream standby to point to the cascading standby."

Are you able to configure a cascading replica by using streaming
replication on your 9.3 system, without WAL archiving on the standby?

-Jeremy

--
http://about.me/jeremy_schneider


В списке pgsql-general по дате отправления:

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: [GENERAL] jsonb
Следующее
От: Ronen Nofar
Дата:
Сообщение: [GENERAL] Query on pg_settings view