-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to connect to PostgreSQL cluster? #4054
Comments
You should have a look at the cluster documentations: https://www.postgresql.org/docs/8.3/static/creating-cluster.html and probably pg-promise that we use under the hood, we pass the URL with a parser so it can be used to connect through the pg-promise library, @vitaly-t any idea? |
It doesn't exist in the driver, see brianc/node-postgres#932 From the |
Thanks @vitaly-t ! |
@vitaly-t does pg-promise supports multiple host connection since for replica, it would be required or is there any other alternative ? |
@shreeramk pg-promise is neutral to this, it is the driver underneath that's expected to support it, as per this issue. They claim that the Native Binding supports it, but I never saw it working, so cannot say. |
@vitaly-t okay. Is there any other way? Like writing a wrapper? Consider if a wrapper is written on top of node-postgres, to handle separate connections to primary and multiple secondary's. Then, if I have total 5 nodes(1 - primary, 4 - secondary) that means using node-postgres i hv to create 5 separate connections. Would you recommend that? Also, if any automatic failover libraries are used at postgres level, then obviously there are chances that if primary goes down then one of the secondary will promoted to primary so how do we handle that scenario in nodejs code. |
@shreeramk There is little I can suggest about it presently. And in any case, you will do better asking about it in that issue, and not here. |
Deploy two PostgreSQL in two machine for high available, how to make Parse connect to the cluster? For example, 'mongodb://' + "10.43.159.58:9927,10.43.159.58:9928" + '/test?replicaSet=volunteer_test&readPreference=primaryPreferred, but PostgreSQL support this style?
The text was updated successfully, but these errors were encountered: