Multiple Postgres databases for Apigee Developer Portal

Hi,

We want to use postgres in a master-slave mode for Developer Portal. While i can configure Postgres in a master-standby mode, how do i tell the Developer Portal about both database instances so that it can automatically failover.

Would the silent config file include both hosts in PG_HOSTS as shown ?

PG_HOST="$NODE5, $NODE6"

or

can we use these variables for DevPortal config files

PG_MASTER=$NODE5 
PG_STANDBY=$NODE6
1 5 818
5 REPLIES 5

Hi @kkhanna,

As far as I know, we cannot do like the case that you have mentioned. If you want to do an HA of Postgres then you'll need to use a VIP(Virtual IP) in front of your Postgres cluster. Do a manual or automated failover to the standby and change the VIP to point to a standby that is promoted as Master.

Postgres doesn't provide this feature out of the box nor does Apigee. But you can explore other alternative ways to do it.

One of the most used is (DRBD, Pacemaker, and Corosync) combination which provides an automated failover to the standby nodes. You can explore this option or go with some of the Commercial tools which provide HA for Postgres.

Also, check this option using HA Proxy and governor script using etcd.

https://github.com/compose/governor

Hope this helps!

Thanks @Mohammed Zuber for the reply. Can you tell then what will the config file look like if we have multiple dev portals for HA.

Hi @kkhanna, If you are going to use a VIP for HA, then the VIP should be configured in developer portal configuration else if you just want to use the Postgres in master/slave configuration and do a manual failover to standby Postgres then you should configure the Master Postgres IP. Please check the documentation here for more details.

@Mohammed Zuber

I don’t WANT to use a master/slave configuration, our goal is for the failover to be automatic. I can configure a VIP infront of the two postgres databases and configure that in the Developer Portal. But then how do i make sure that the two database instances are in sync.

On a side note, i see a lot of documentation on how to use MySQL in master-master configuration with Developer portal but the newer versions of Dev Portal recommend using Postgres, updates to the documentation to reflect this would be very nice. @Anil Sagar

Do you have any updates regarding this for Private Cloud from 17.01 version. @gkoli@apigee.com

Any updates regarding this ?

Thanks! 🙂