If I register 2 instances of a service, let’s say memcached, instances A and B.
I want to use only one at a time.
So A is used and B is standby.
A break, B is used.
A is back, it will be the new standby.
How would I achieve this with consul? service-resolver?
Yes, I spotted this should be defined with a filter.
The documentation is not as clear with consul as with other hashicorp products. Or maybe I’m looking at it from a different philosophy than the one it was designed for.
Found!
I was setting it as a normal configuration file in /etc/consul.d where consul config write was what I should use.
It doesn’t work yet but The config is validated, etc… I’ll work deeper on it.
Thank you.
OK, I think I’m missing a last thing.
If I to a DNS query over memcached.service.consul, I still get both instances and the order changes upon requests, just like if my config did nothing.
@aminancelot I tested your configuration and was able to get it to work in my environment. I don’t see any issues with it.
Are you spawning the proxy with consul connect envoy -sidecar-for memcached?
The Envoy proxy is required to use any of the L7 features in Connect. Be sure to use that over the built-in proxy (i.e., consul connect proxy -sidecar-for …).
And I’m terribly disappointed.
Every Hashicorp product I interacted with in my career was a pleasure, great products, great doc.
Even if someone would craft the solution of this specific simple use case for me, I cannot tell a dev team to craft their own services definitions, knowing it will be a pain and wasted time.
Consul is supposed to make our life easy, be easily understood.
All I found was contradictory examples for which none worked, unhelpful error messages, etc…
I think the principle of consul is great, full of great ideas, full of potential, after all it’s an hashicorp product but I cannot inflict the pain to my coworkers.
I will look for an alternative.
Thanks a lot for the help, I hope this will get fixed and once it does, I will look at it again with pleasure.
I’m sorry to hear that you have had such a frustrating experience with Consul’s documentation. From looking at this thread I have small glimpse into some of the challenges you’ve faced. It sounds like there were quite a few more, and there is a significant opportunity to improve Consul’s documentation.
I am a product manager on the Consul team. I am interested in understanding the specific areas of docs that you found lacking, or containing contradictory information. Would you be willing to speak with me to discuss this in more detail? I would like to ensure we address these problem areas so that you have a more positive experience should you decide to re-evaluate Consul in the future.