If we have several nodes in cluster, can I specify all ip addresses in the connection string in JDBC
We have several nodes in a cluster with each node having a private IP address. What is the best way to connect to the cluster from JDBC? Do I need to specify only one IP address in the connection string? Can I specify all ip addresses so if one node is not available, I can still connect? If all my nodes are behind a private network, do I need one public IP for the whole cluster or do I need one public IP per node?
0
Comments
I believe there exist a public network and a private network.
So a 3 node cluster will have 3 public IP's and 3 private IP's.
Its not recommended to use private IP for client interactions, so we always use a public IP addresses whenever specifying the jdbc url.
Coming to your question, we can define a single IP address in a JDBC url and not more than that
If you want your jdbc connection to connect to a any nodes in cluster then you need to ahve a load balancer, so that your request can be submitted by load balancer to appropriate node depending on the loads
You need to create a virtual hostname or IP address which will be given by Load balancer and then this IP address can be used in the jdbc connection. This will make sure that if any node goes down, your request/query will be diverted to another node ' on the fly '
Hope this helps
I found this documentation
Vertica - Load Balancing.
Hope this helps.
Thanks Navin for answering this!
I just wanted to call something out in the document that Navin linked to: As of Vertica 7, Vertica's client drivers support load-balancing natively within the driver. This feature must be enabled in both the client and the server in order to work (see the documentation); once it has been enabled, you can connect to any node in the cluster and Vertica will redirect your connection to an appropriate node automatically using that node's public IP address. For this to work, you must of course grant access to more than one node's public IP.
Adam
https://my.vertica.com/docs/7.0.x/HTML/index.htm#Authoring/ProgrammersGuide/ClientJDBC/NewFeaturesIn...
https://my.vertica.com/docs/7.0.x/HTML/index.htm#Authoring/AdministratorsGuide/LoadBalancing/AboutNa...
https://my.vertica.com/docs/7.0.x/HTML/index.htm#Authoring/ProgrammersGuide/ClientJDBC/EnablingNativ...
Check what to set for below the connection properties:
ConnectionLoadBalance, BackupServerNode
I was curious to know, if Vertica 7 has come up with native connection handling for ADO.net driver.
I could not find it for ADO.net driver in the documentation.