Re: [GENERAL] issue performing a switchover with repmgr

Поиск
Список
Период
Сортировка
От Dylan Luong
Тема Re: [GENERAL] issue performing a switchover with repmgr
Дата
Msg-id 6f2371c0d39945518ca478b8cd9a47ad@ITUPW-EXMBOX2B.UniNet.unisa.edu.au
обсуждение исходный текст
Ответ на Re: [GENERAL] issue performing a switchover with repmgr  (Adrian Klaver <adrian.klaver@aklaver.com>)
Ответы Re: [GENERAL] issue performing a switchover with repmgr  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
Thanks for you answer. So is there a way to remove this -w from the repmgr switchover process?

-----Original Message-----
From: Adrian Klaver [mailto:adrian.klaver@aklaver.com]
Sent: Monday, 22 May 2017 10:27 PM
To: Dylan Luong <Dylan.Luong@unisa.edu.au>; pgsql-general@postgresql.org
Subject: Re: [GENERAL] issue performing a switchover with repmgr

On 05/22/2017 01:15 AM, Dylan Luong wrote:
> Hi
>
> I have setup a master/standby on PostgreSQL95 on two test servers and
> trialing out repmgr. (https://github.com/2ndQuadrant/repmgr/)
>
> I am testing a switchover using the following:
>
> -bash-4.1$ repmgr -f /etc/repmgr/9.5/repmgr.conf -C
> /etc/repmgr/9.5/repmgr.conf standby switchover -L DEBUG -v
>
> The switchover appears to hang at the last part of the switchover process....
>
> /NOTICE: restarting server using '/usr/pgsql-9.5/bin/pg_ctl  -w -D
> /var/lib/pgsql/9.5/data -m fast restart'/
>
> /pg_ctl: PID file "/var/lib/pgsql/9.5/data/postmaster.pid" does not
> exist/
>
> /Is server running?/
>
> /starting server anyway/
>
> It appears to have worked though as when I run the cluster show
> command on both servers it showing the switchover.
>
> /-bash-4.1$ repmgr -f /etc/repmgr/9.5/repmgr.conf cluster show/
>
> /Role      | Name           | Upstream       | Connection String/
>
> /----------+----------------|----------------|------------------------
> -------------------/
>
> /* master  | itupl-postgen2 |                | host=10.70.3.252
> dbname=repmgr user=repmgr/
>
> /  standby | itupl-postgen1 | itupl-postgen2 | host=10.70.3.251
> dbname=repmgr user=repmgr/
>
> It is also showing correctly in repl_nodes table of the two databases.
>
> Why is it hanging?? Thank you for your help...

You are using -w

https://www.postgresql.org/docs/9.5/static/app-pg-ctl.html

"-w

     Wait for the startup or shutdown to complete. Waiting is the default option for shutdowns, but not startups. When
waitingfor startup, pg_ctl repeatedly attempts to connect to the server. When waiting for shutdown, pg_ctl waits for
theserver to remove its PID file. This option allows the entry of an SSL passphrase on startup.  
pg_ctl returns an exit code based on the success of the startup or shutdown.
"

So pg_ctl was trying to connect the server and did not find it at first:

"pg_ctl: PID file "/var/lib/pgsql/9.5/data/postmaster.pid" does not exist. Is server running?"

but continued with the process:

"starting server anyway"

FYI in Postgres 10+ -w is the default for pg_ctl.



>
> Here is the complete output:
>
> /----------------------------------------------- /
>



--
Adrian Klaver
adrian.klaver@aklaver.com


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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: [GENERAL] logical replication in PG10 BETA
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: [GENERAL] issue performing a switchover with repmgr