Skip to content
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

Support connecting to multiple hosts #23

Open
amirtuval opened this issue Dec 23, 2014 · 5 comments
Open

Support connecting to multiple hosts #23

amirtuval opened this issue Dec 23, 2014 · 5 comments

Comments

@amirtuval
Copy link

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

@wvanbergen
Copy link
Owner

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
#23.

@amirtuval
Copy link
Author

OK, Thanks.

I'll look into it

@ayashjorden
Copy link

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

@amirtuval
Copy link
Author

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

@emschwar
Copy link

emschwar commented Nov 29, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants