PgSql 9.4 onwards - Mailing list pgsql-general

From Vikas Sharma
Subject PgSql 9.4 onwards
Date
Msg-id CAN6gwKxBMnieG__B7G9U5mFUE86CFhjS7KBY1Lbx4c6iMgNDtw@mail.gmail.com
Whole thread Raw
List pgsql-general
Hi,

We are using PgSql 9.4 & 9.5 with repmgr 3.5. 
Repmgr works properly and great in promoting a standby to Master when automatic failover is enabled. 

The issue we have is with the old master, if master was unavailable due to network problem, though pgSql was up and running on it we end up with 2 masters. 

Another scenario is with VMs we have databases on. Whenever VMs are started, sometimes Standby VMs starts first and then again we end up with 2 masters.

Is there a way that the old master  shoot/ stop itself when the standby is promoted to master and as soon as the network is restored?

Is there a way to stop the pgSql starting up on standby if master is not available yet?

For the 2nd question I have a feeling that I should create a shell script ( and call when pgSql starts) to check the state of pgSql on the server, e.g if this a standby don't start it up if master not available, if this is master and other replicated node is promoted to master then don't start it up. I am not sure if I can cover all the permutations and combinations.

Let me know please if someone had done something like this.

Regards
Vikas


pgsql-general by date:

Previous
From: Melvin Davidson
Date:
Subject: Re: PGSQL 10, many Random named DB
Next
From: Rob Sargent
Date:
Subject: \g filename