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

cli: add a flag to allow listening on all interfaces #6862

Closed
wants to merge 6 commits into from
Closed

cli: add a flag to allow listening on all interfaces #6862

wants to merge 6 commits into from

Conversation

tamird
Copy link
Contributor

@tamird tamird commented May 23, 2016

This permits users to use the --host and --port flags to control the
node's advertised external address while listening on all interfaces.

Fixes #1008.

cc @mberhault


This change is Reviewable

@bdarnell
Copy link
Contributor

See also #5816, which is a request for a way to bind to multiple specific interfaces (but not all of them). I think it may be better to go ahead and implement a list of secondary addresses to bind instead a special case to bind to everything.

@tamird
Copy link
Contributor Author

tamird commented May 24, 2016

FYI it's not so simple (golang/go#9334), so the multiple --host flags suggested in #5816 won't work.

@petermattis
Copy link
Collaborator

@tamird Can't you create a new listener for each address you want to listen on? You could probably wrap that up in a MultiListen method that does the multiplexing internally.

@mberhault
Copy link
Contributor

what does this give us over the use of --host=0.0.0.0?

@petermattis
Copy link
Collaborator

@mberhault You can specify exactly which interfaces you listen on.

@mberhault
Copy link
Contributor

sorry, I meant what does this current PR give us that 0.0.0.0 doesn't? we're still only allowing one interface or all.

@tamird
Copy link
Contributor Author

tamird commented May 24, 2016

right, but --host currently controls the advertised address as well as the listening address

@mberhault
Copy link
Contributor

sure, but that has nothing at all to do with what we listen on. I would prefer to see --host control which interface(s) we bind to, and a separate flag overriding our advertised address.

@tamird
Copy link
Contributor Author

tamird commented May 24, 2016

Updated, PTAL.

@tamird tamird mentioned this pull request May 25, 2016
@tamird tamird closed this Oct 3, 2016
@tamird tamird deleted the cli-external-address branch October 3, 2016 23:28
irfansharif added a commit to irfansharif/cockroach that referenced this pull request May 4, 2017
Related to cockroachdb#1008, extending cockroachdb#9503. Also see cockroachdb#6862.
The flag enables any given node to advertise it's listening port. We
have a similar mechanism for just the hostname, this would enable us to
use this in conjunction with `--advertise-host` to construct an
advertised address. Necessary when running behind a proxy or equivalent
where internal and external ports differ.
irfansharif added a commit to irfansharif/cockroach that referenced this pull request May 9, 2017
Related to cockroachdb#1008, extending cockroachdb#9503. Also see cockroachdb#6862.
The flag enables any given node to advertise it's listening port. We
have a similar mechanism for just the hostname, this would enable us to
use this in conjunction with `--advertise-host` to construct an
advertised address. Necessary when running behind a proxy or equivalent
where internal and external ports differ.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants