vertica icon indicating copy to clipboard operation
vertica copied to clipboard

Support connecting to multiple hosts

Open amirtuval opened this issue 10 years ago • 5 comments

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

amirtuval avatar Dec 23 '14 12:12 amirtuval

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.

wvanbergen avatar Dec 24 '14 11:12 wvanbergen

OK, Thanks.

I'll look into it

amirtuval avatar Dec 24 '14 12:12 amirtuval

Hi @amirtuval This looks very interesting. Suggested is that if vertica_config host element is:

  1. a plain String, the library will attempt to connect, raising an exception upon failure.
  2. 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

ayashjorden avatar May 24 '16 12:05 ayashjorden

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

amirtuval avatar May 24 '16 19:05 amirtuval

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

emschwar avatar Nov 29 '17 22:11 emschwar