-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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 advertise-host flag to start command #9503
Conversation
CC @mberhault re: |
I'd be in favour of replacing http-addr with http-host. Reviewed 8 of 8 files at r1. cli/flags.go, line 46 at r1 (raw file):
what's this? cli/start.go, line 135 at r1 (raw file):
cli/cliflags/flags.go, line 158 at r1 (raw file):
s/address/hostname/? cli/cliflags/flags.go, line 171 at r1 (raw file):
ditto server/server.go, line 498 at r1 (raw file):
s,grpc/postgres server, CockroachDB node, Comments from Reviewable |
Agreed that Reviewed 8 of 8 files at r1. cli/kv.go, line 48 at r1 (raw file):
I think this still wants to use server/testserver.go, line 85 at r1 (raw file):
I think that instead of saying Comments from Reviewable |
eeefb64
to
207a666
Compare
Responding directly since I haven't been able to get reviewable to work on this wifi.
Opened #9516 to discuss/track.
Bad cherry-pick from when I first did this on top of develop. Removed.
Done.
Done.
Done.
Done.
Done. It was effectively equivalent due to our setting of AdvertiseAddr to Addr, but makes more sense as just Addr.
It's being filled in with whatever we're actually listening on by server/server.go in the unresolvedAdvertAddr logic, the same as how we update Addr based on whatever address we actually use. Not setting it here causes a lot of breakages. |
Reviewed 6 of 6 files at r2. server/server.go, line 497 at r1 (raw file):
leave this one as before, it actually matters (because we might coalesce ports further in the future, and for parity with the HTTP{,S} log line above) server/testserver.go, line 85 at r1 (raw file):
Comments from Reviewable |
207a666
to
10bc7aa
Compare
Enables overriding the interface(s) that the server is listening on for the purposes of picking an address to advertise via the gossip network. Could reasonably be expanded with advertise-port if anyone hits a case where port forwarding causes issues (could potentially happen in some docker deployments). For what it's worth, it's a little weird that we have `--host` and `--port` to contrast with `--http-addr` and `--http-port`. Should we try to phase out `--http-addr` and replace it with `--http-host`?
10bc7aa
to
8bb3226
Compare
So apparently it wasn't the bad internet causing reviewable to break, it's something about this branch that reviewable doesn't like.
Done. |
lgtm |
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.
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.
Enables overriding the interface(s) that the server is listening on
for the purposes of picking an address to advertise via the gossip
network.
Could reasonably be expanded with advertise-port if anyone hits a case
where port forwarding causes issues (could potentially happen in some
docker deployments).
For what it's worth, it's a little weird that we have
--host
and--port
to contrast with--http-addr
and--http-port
. Should wetry to phase out
--http-addr
and replace it with--http-host
?Fixes #1008
@tamird @sploiselle
This change is