-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Advertise Ports #550
Comments
Apparently |
When setting
and
Interestingly enough it can join the cluster. |
+1, this is a very critical feature for running multiple clients on the same host (with Docker). Also when 8301 can not be opened in the host's firewall. What happens now is that the client continually flaps. "sssssooooo cclooooosseeeeee, aaaaaarg" 😄 |
Same problem here with marathon, docker and consul. |
It makes sense that the node is able to join, since the join operation is being performed from the new node and is an outbound UDP message. Sounds like the problem starts once the new node's address is gossiped, and other nodes in the cluster begin pinging it for health status. What |
Sorry about the delay, just getting back from holidays. I agree this makes sense, but I think the only port that you can really advertise is the RPC port. The other ports are not gossiped around and generally do not need to be accessible over the network. Since the RPC port is included in the gossip messages this shouldn't be too hard. Not sure why advertise address is causing the node to suspect itself. Must be a bug. |
@ryanuber I have a config file for the container stuff:
Consul is properly starting with it. @armon I understand. I will look into how to advertise the RPC port. Maybe you have some pointers for me what needs to be considered. Is there anything I can provide to help identify the bug regarding the self-doubts of the node? |
@armon Thank you so much for looking into this! 🍺 Happy new Year! 🍻 |
@i0rek Take a look at consul/server.go setupSerf(). Basically the "port" value we gossip out is the RPC port, which currently is setup to the real port. I guess there could be a new AdvertisePorts configuration that would allow a different port value to be gossiped out which would be set there. |
An |
@i0rek with respect to the self-suspect, a dump of "consul members" and "consul members -detailed" would be useful. Looking through the memberlist code, not sure how this is possible. |
@armon this is what I see when I start consul in the container:
and after a minute or so:
|
this is what happens on the cluster leader:
EDIT1: I updated the logs to make sure it is a single start. |
@ryanuber you were right and I was wrong. I got the configuration option wrong. Consul doesn't start anymore now that I am using the right one.
|
I would vote for accepting the port in |
@i0rek I pushed #576 yesterday which should help us avoid this confusion in the future. As for
|
Alternatively, you might want to try tweaking the |
@ryanuber I've tried that, it only works when all the nodes have the same ports, which defeats the purpose. We need to be able to advertise the port along with the address. |
@ryanuber thanks for #576! |
* Fix bug where upstream env vars not set Fixes issue where we weren't setting the upstream environment variables when the upstream annotation was set: * <NAME>_CONNECT_SERVICE_HOST * <NAME>_CONNECT_SERVICE_PORT Since we're modifying a slice's values during iteration we must access the element via reference using the index.
I want to suggest another configuration option and I am curious what you think. Similiar to
AdvertiseAddr
I want to introduceAdvertisePorts
. It would be very similiar to the existingPorts
configuration option.AdvertisePorts
would allow to specify the ports a consul client is reachable on.Use case: I want to run consul client in a container. I have multiple containers per host and multipe hosts. There is a seperate host running consul server. My problem is that I can use
AdvertiseAddr
to communicate the container host ip, but I cannot configure different ports. Without it I can only run one consul per host because the ports are claimed then.The text was updated successfully, but these errors were encountered: