Re: [HELP] Issue with standby server using WAL archive

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: [HELP] Issue with standby server using WAL archive
Дата
Msg-id 20200702141444.GJ3125@tamriel.snowman.net
обсуждение исходный текст
Ответ на [HELP] Issue with standby server using WAL archive  (Praveen Kumar K S <praveenssit@gmail.com>)
Ответы Re: [HELP] Issue with standby server using WAL archive  (Praveen Kumar K S <praveenssit@gmail.com>)
Список pgsql-admin
Greetings,

* Praveen Kumar K S (praveenssit@gmail.com) wrote:
> Config on Master:
> archive_mode = on
> archive_command = 'test ! -f /mnt/server/archivedir/%f && cp %p
> /mnt/server/archivedir/%f'

You really shouldn't use 'cp' or such a simple archive command, you'll
very likely lose WAL on a system crash with that setup.

> Config on standby:
> standby_mode = 'on'
> restore_command = 'cp /mnt/server/archivedir/%f %p'
>
> Before starting standby, I took base backup
>
> pg_basebackup -v -D main -R -P -h pg1 -p 5432 -U replication
> pg_basebackup: initiating base backup, waiting for checkpoint to complete
> pg_basebackup: checkpoint completed
> 43518/43518 kB (100%), 1/1 tablespace
>
> NOTICE:  pg_stop_backup complete, all required WAL segments have been
> archived
> pg_basebackup: base backup completed
>
> Now, copied recovery.conf to data directory
>
> Started postgres server on standby and seeing below error in log.
>
> 2020-07-02 13:14:02.134 UTC [7643] postgres@template1 FATAL:  the database
> system is starting up
> 2020-07-02 13:14:02.644 UTC [7646] postgres@template1 FATAL:  the database
> system is starting up
> 2020-07-02 13:14:03.154 UTC [7649] postgres@template1 FATAL:  the database
> system is starting up
> 2020-07-02 13:14:03.664 UTC [7652] postgres@template1 FATAL:  the database
> system is starting up
> 2020-07-02 13:14:04.174 UTC [7655] postgres@template1 FATAL:  the database
> system is starting up
> cp: cannot stat '/mnt/server/archivedir/00000001000000000000000D': No such
> file or directory
> 2020-07-02 13:14:04.684 UTC [7660] postgres@template1 FATAL:  the database
> system is starting up
> 2020-07-02 13:14:05.194 UTC [7663] postgres@template1 FATAL:  the database
> system is starting up
> 2020-07-02 13:14:05.197 UTC [7664] [unknown]@[unknown] LOG:  incomplete
> startup packet
> cp: cannot stat '/mnt/server/archivedir/00000001000000000000000D': No such
> file or directory
> cp: cannot stat '/mnt/server/archivedir/00000001000000000000000D': No such
> file or directory

> Am I missing anything here ? Please suggest. TIA.

Do you have hot_standby enabled in postgresql.conf?  What version of PG?

Thanks,

Stephen

Вложения

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

Предыдущее
От: M Jane
Дата:
Сообщение: Re: pg_dump backup issue
Следующее
От: Praveen Kumar K S
Дата:
Сообщение: Re: [HELP] Issue with standby server using WAL archive