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

DNS names that resolve to multiple records (SRV, etc) don't play nice with "method" configuration #354

Closed
chrisboulton opened this issue Feb 16, 2017 · 1 comment

Comments

@chrisboulton
Copy link

I'm 50/50 on if I consider this a bug, or a feature enhancement - it was just somewhat unexpected because it wasn't super spelled out in the documentation.

For a while now, we've been using log-courier configured to connect to a Consul service @logstash.service.consul, and had method: loadbalance configured in our configuration file.

We'd assumed that with this in place, we'd have log-courier doing client side load balancing for us, but that didn't seem to be the case - log-courier would only ever pick one record at a time and connect to it, vs all.

When I switched out the single hostname for a list of the servers, the load balancing functionality worked as expected and we had connections established to each server.

Maybe if there aren't plans to fix this, it could be spelled out in the docs? I'm happy to submit a PR if we think that's the right direction for now.

@driskell
Copy link
Owner

This is a great idea.

It may need some reworking of how addresses are loaded, but possibility to improve across the board. At the moment address lookups are performed "as needed", such as during initial connection and during reconnect, with one exception: if a lookup returns multiples addresses, it pulls from those secondary addresses on reconnect rather than doing a new lookup. This means connecting to "localhost" on most server would mean an attempt to connect to "::1" on IPv6, before then connecting to "127.0.0.1" on next attempt. SRV fits into this same thing. It will resolve multiple hosts and then queue them.

I guess the target here is for SRV to be expanded first to produce the full server list. Then to use that list as if it were configured. Do you think the lookup would need repeating though to keep the server list up to date? Or would an initial lookup on startup be sufficient (and another lookup on each configuration reload I would guess!)

@driskell driskell added this to the v2.8.0 milestone Oct 21, 2021
@driskell driskell modified the milestone: v2.8.0 Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants