-
Notifications
You must be signed in to change notification settings - Fork 49
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 list vor env "CRATE_HOST" #452
Comments
@SBlechmann thanks for the suggestion!
That's correct.
Yep, spot on. Also in a K8s deployment you could just set This is what we tend to do with our deployments and it has the advantage that we're not limited to a static list of nodes---as it'd be the case if |
@c0c0n3 as always: Thanks for the very fast response! Well, I believe I really have to switch to k8s soon.. it's still in my bucket list. Thanks for sharing your thoughts! BTW: In another issue I said that I wanted to conduct some performance tests. Just at on Tuesday I got to implement 0.8 and seriously, guys, the step from 0.7.5(6) to 0.8 is huge. Thank you for the new performance improvements and way better docs! |
Pleasure! We try to tend to GH issues from the community as quickly as we can, but sometimes we've got so much in our plate that it could take us a couple of days to go through the list...
Obviously, you're the best person to judge what you need given your use case and requirements. If you go with K8s, these Helm charts might be useful to whip together a FIWARE cluster: But it could be overkill for your scenario, I have no idea :-) What I know is that K8s has a steep learning curve (well at least that was the case for me, but I'm not the brightest chap out there) and might not be worth it for simple scenarios where e.g. a simple Docker compose or plain OS services would do. For example, you could even run QuantumLeap outside of Docker with
which can easily be hooked into a systemd unit. (You could also use a separate GUnicorn instance, tweak GUnicorn config, etc.)
Indeed. It shouldn't be too hard to implement actually and like you pointed out it comes in handy for simple scenarios. One thing that I'd like to find out though is if the Crate guys have any plans to do that in the Crate driver. So I'm summoning the Mighty Motl, @amotl do you know if it could be possible for the Crate client to populate the list of servers dynamically by querying the Crate cluster topology given the address of a configured cluster member? The CrateDB logs seem to give away that each node in the cluster is actually aware of the cluster topology, but I could be wrong!!
Kudos to @chicco785 :-) |
Hi there, thanks for bringing up that topic. I discussed that with @mfussenegger and @seut already and they told me that a simple roundrobin-like distribution/balancing mechanism is implemented in On the PostgreSQL interface side (see also #407), I also would like to reference psycopg/psycopg2#602 and sqlalchemy/sqlalchemy#4392 here just for the sake of completeness. Specifically attaching to people aiming to run CrateDB on Kubernetes, I also would like to point out
On this matter, I just created crate/crate-operator#170 which might yield some more insights how things may be improved on those aspects how to assemble things in an advanced manner. With kind regards, [1] http://cbonte.github.io/haproxy-dconv/2.3/configuration.html#4-balance |
Hi @amotl Thank you so much for this, you're awesome.
is it doing round robin on the list of servers you pass in when you create the client: or is it also fetching the cluster topology from the nodes currently in the Crate cluster? e.g. if I have a Crate cluster with 4 nodes,
Excellent! Note to self: when tackling this issue, implement the same changes in the timescale backend too.
Like I said some time ago, we're very excited about this new addition to the Crate family! |
Hi @c0c0n3,
Exactly. Currently, there is no further smartness here. Whether it would be actually possible to inquire topology information from the cluster itself might get revealed on an eventual discussion at crate/crate-operator#170. From MongoDB, I know the Python client driver supports cluster node discovery:
However, I don't know if it will be possible to implement with CrateDB. Let's wait what the core developers will have to say about this and maybe also file another ticket at https://github.com/crate/crate in order to signal demand for such a feature. With kind regards, |
Hi @amotl, thanks for clarifying. On second thought, I think regardless if the Crate client will eventually support node discovery, QuantumLeap should support reading a list of Crate hosts from config. In fact, as @SBlechmann pointed out, this feature would be useful right away, since the Crate client can already work quite happily with a list of servers. If one day, you guys implement node discovery, all the better. Those hosts you configure in QuantumLeap will serve as discovery seeds, like it happens in e.g. Mongo. |
Hi again, at crate/crate-operator#170, @SStorm and @WalBeh provided more insights into how It would still be helpful if With kind regards, |
Hi once more, after talking to @WalBeh (thanks again!), I want to add some more important details in order to clarify the situation. When using However, when running K8s in an on-premise environment, this has to be done using a different technology than what the IaaS LB components provide. For example, he mentioned MetalLB in this context. With kind regards, |
@amotl thanks alot for all the info!
Thanks, for pointing it out I'd totally missed that after reading the other thread! |
Hey there, apperently, I got some discussion rolling o.o Thanks for all the contributions @c0c0n3 @amotl My thought of providing more than one crate host (e.g. service - I'm using docker swarm terminology) was meant to deal with use cases where you have different crate nodes with different roles (e.g. data-node // manager // combinations).
So for me right now I will just create simpler setups where all nodes are equal so I can use deploy mode global and don't have to deal with the issue yet, right? (swarm) Thanks for your time! |
hey @SBlechmann
Pleasure!
Definitely, not sure exactly when, but keep tabs on this issue :-)
Well, I suppose it depends on where QL sits (e.g. outside/inside the swarm), whether you're doing load balancing e.g. HAProxy, etc. Not sure what your actual set up is.
I've got no experience with Azure, but I suppose if you're not using a managed K8s service and you just roll out your own K8s on bare Azure nodes, you could have a Crate stateful set with a service that takes care of distributing requests coming from e.g. QL to the Crate pods in the stateful set. In this case all your QL instances would be configured to use one address in Here's an (simplified!) example of what kind of Crate service those charts would install on a bare-bones K8s cluster
and here's the (simplified!) stateful set:
Now with this set up, you could run a bunch of QL pods in the same namespace ( |
Stale issue message |
Is your feature request related to a problem? Please describe.
If I understood correctly currently QL only supports one crate host given through the env variable "CRATE_HOST". So if I set up my crate cluster on different nodes, each with another configuration (that's why I didn't use "mode: global" and thus have multiple crate services), I cannot give QL a list of the services / IPs. Is that right?
Describe the solution you'd like
Implement the possibility to use a list of different services / crate hosts and the cluster's name // replicaset similar to when orion handles different mongo hosts.
Describe alternatives you've considered
I believe putting a proxy in front of crate that connects all crate nodes could work as well.
Additional context
Thanks for looking into this :)
The text was updated successfully, but these errors were encountered: