Giter Site home page Giter Site logo

Comments (4)

silas avatar silas commented on June 12, 2024

Looking at the Go API client it seems like they're against this:

If they end up adding this to the Go client I'd consider replicating the functionality here, but I think it's better to just follow their lead around how API clients should work.

It seems like you're best bet is to 1) put consul behind a load balancer or 2) handle the failover logic in your application.

from node-consul.

matthiasschoger avatar matthiasschoger commented on June 12, 2024

Sorry, I probably didn’t make myself clear.

I was proposing for your client to have one connection to one Consul instance from the list.
Only if that instance goes down or is unavailable, the client should select another Consul instance from the list.

In every case, only one connection exists at the same time from the client to a Consul instance.

from node-consul.

silas avatar silas commented on June 12, 2024

Yeah, that's what I understood you to mean.

What "down or ... unavailable" means is pretty complicated, and the experience is going to be bad in all but the most trivial cases (e.g. DNS doesn't resolve, DNS times out, HTTP port not open, HTTP times out, TLS certificate invalid, Consul no longer a member of the cluster, etc...).

If you have a definition of what down or unavailable means to you it should be pretty easy to create a wrapper for the client to handle those cases. If you don't want to do that setting up a load balancer is probably going to be the most reliable solution.

from node-consul.

matthiasschoger avatar matthiasschoger commented on June 12, 2024

Just read the comment on the Consul thread in detail, and I think I understand better now.

Seems like the recommendation is to connect the the local Consul agent by default. Makes sense and should cover my use-case.
Closing this issue.

from node-consul.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.