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@xxxxxxxxxxx] Sent: Monday, 22 May 2017 10:27 PM To: Dylan Luong <Dylan.Luong@xxxxxxxxxxxx>; pgsql-general@xxxxxxxxxxxxxx Subject: Re: 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 waiting for startup, pg_ctl repeatedly attempts to connect to the server. When waiting for shutdown, pg_ctl waits for the server 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@xxxxxxxxxxx -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general