vertica
vertica copied to clipboard
Support connecting to multiple hosts
Hi,
Looking at the documentation and the code, it does not seem possible to specify multiple hosts to connect to, and have the adapter connect randomly to a host from that list.
That means that even if I have many nodes in the cluster, all my clients will connect to the same machine. More than that, if that single machine is down, my clients will not be able to connect even if the cluster is functional.
Is there support for something like that, that I missed? If not, do you have experience with something like this, and can offer advice on how to implement it?
Thanks Amir
There's no support for this currently. If tou want to work on it: The necessary code should probably live in connection.rb.
On Tuesday, December 23, 2014, amirtuval [email protected] wrote:
Hi,
Looking at the documentation and the code, it does not seem possible to specify multiple hosts to connect to, and have the adapter connect randomly to a host from that list.
That means that even if I have many nodes in the cluster, all my clients will connect to the same machine. More than that, if that single machine is down, my clients will not be able to connect even if the cluster is functional.
Is there support for something like that, that I missed? If not, do you have experience with something like this, and can offer advice on how to implement it?
Thanks Amir
— Reply to this email directly or view it on GitHub https://github.com/wvanbergen/vertica/issues/23.
OK, Thanks.
I'll look into it
Hi @amirtuval This looks very interesting. Suggested is that if vertica_config host element is:
- a plain String, the library will attempt to connect, raising an exception upon failure.
- an array, random IP will get selected and attempt connection. upon failure, the failing IP is removed from the array and another random one gets selected, this until the array is empty, raising and exception.
WDYT? Yarden
Hi, Yarden
This post was long ago :-)
I ended up setting up a load balancer (we are on aws, so I am using elb), and that solved that issue. I still think it is a good idea - you are welcome to pursue it. I'm afraid I didn't.
Amir
FWIW, Vertica now supports (at least as of 7.2 maybe earlier) native connection load balancing, where you can connect to any node and the query that you issue may actually run on any other node.
An example of this is shown in https://my.vertica.com/docs/7.2.x/HTML/index.htm#Authoring/ConnectingToHPVertica/ClientODBC/EnablingNativeConnectionLoadBalancingInODBC.htm