[pgpool-general: 3050] Re: failover issue

jayknowsunix at gmail.com jayknowsunix at gmail.com
Thu Jul 24 04:41:26 JST 2014

My original version was a failover.sh script and it was calling "service PostgreSQL-9.3 restart" the problem is that restart requires root for the service command or "sudo" which won't work due a "needs a tty error". I've implemented per your suggestion a pg_ctl as that runs as Postgres. Thanks for the suggestion! It's now working perfectly.

Sent from my iPad

> On Jul 23, 2014, at 2:49 PM, Richard Michael <rmichael at edgeofthenet.org> wrote:
> Use "pg_ctl restart", you may need "pg_ctl -D $YOUR_PGDATA_DIR
> restart" ; depending how your system is configured (e.g., if the
> cluster you're restarting is not in the default location).
> Also, consult "man pg_ctl" and check if any other options apply to
> your configuration (timeout, restart type, etc.).  Though, I suspect
> the default invocation I mentioned will be sufficient.
> Alternatively, write a tiny wrapper to use as the "failover_command",
> and have that wrapper do something like: "sudo service postgresql-9.3
> restart" (after adding an appropriate sudo rule).
> Hope this helps,
> Richard
>> On Wed, Jul 23, 2014 at 11:44 AM, John Scalia <jayknowsunix at gmail.com> wrote:
>> By my understanding, when a change is made in the recovery.conf file, then
>> it is necessary to restart postgresql. So, with 2 different standby servers
>> and the failure of the primary, the first standby gets promoted to master
>> and the second standby must have the primary_conninfo changed to point to
>> the new master. From what I've found online, this change will not be read in
>> with only a reload.
>> But, as the failover_command is run with the postgres userid, you cannot, on
>> Linux, use a "service postgresql-9.3 restart" as that requires root, but
>> could I use pg_ctl to force a reload without becoming root? If so, what
>> would the pg_ctl command look like?
>> --
>> Jay
>> _______________________________________________
>> pgpool-general mailing list
>> pgpool-general at pgpool.net
>> http://www.pgpool.net/mailman/listinfo/pgpool-general

More information about the pgpool-general mailing list