MMAgeek
Enthusiast
Enthusiast

external database jdbc url when using a postgres master-slave cluster

Hi

I have read the document here Scaling for the Information Explosion: Master-Slave Cluster with vFabric Postgres 9.2 on vSphere | V...and the document that details how to setup workspace to use an external postgres DB but it is missing some config info when using a master-slave cluster


When i have set up the cluster should the jdbc url point to the master host? If the cluster fails over how does Workspace know to point at the secondary host? It doesnt appear that there is a dedicated cluster IP/hostname i can point to?

Or do i need to create a DNS CNAME that points to the master and change that manually in a failover event?

Thanks

0 Kudos
3 Replies
MMAgeek
Enthusiast
Enthusiast

*bump* Can anyone help with this? Or should i be asking in the vFabric forums?

0 Kudos
MMAgeek
Enthusiast
Enthusiast

I asked this question on the vfabric forums and received this answer from one of the postgres devs https://communities.vmware.com/thread/455006

I thought i would repost it here in case anyone else finds it useful. I must admit I am finding the lack of documentation around some some horizon features slightly annoying. I will try this on our lab environment and see what happens.

---------

Since 9.2.4, vPostgres appliance includes some scripts dedicated to this task, making your life far easier. So you don't need to do all those steps manually on the server side. More information here:

New replication features of vFabric Postgres 9.2.4 | Next-Generation Data Platforms Blog - VMware Bl...

Then for managing a switchover to a slave in case of a master failure, JDBC has some basic implementation in its code that has been introduced one year ago with commit 39b085d and you can specify multiple URLs like that:

jdbc:postgresql://host1:port1,host2:port2/test

Connection is chosen in round-robin fashion until success. There is no documentation about that though... I'll ping the jdbc devs to correct that. If you are using an older version of JDBC, you should switch to another solution, like a tomcat layer.

0 Kudos
MMAgeek
Enthusiast
Enthusiast

Appears that this doesnt work with Workspace, I am unable to specify multiple servers in the JDBC URL field. Looks like I'll be logging a call with VMware Support