-
Notifications
You must be signed in to change notification settings - Fork 316
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
Habitat should hunt for an available port if 9631 and 9638 are unavailable #3025
Comments
This may be a bit difficult to get done seeing we have an "initial peer" problem already, but it's something we should keep in mind as we attempt to solve for initial peer |
The default behavior on Linux is to pick a random port if So, it's possible now but very user unfriendly; would be awesome if it was nice instead. |
that's a neat idea @smith ! unfortunately not usable for the gossip port, because it advertises itself to the census as having a gossip port and http port of
|
agreed @reset - I've solved for the initial peer problem in my configuration, but you gotta gotta know which one is Habitat Prime and that one must be on the default port. |
Interesting, I may have actually pissed off all the supervisors in my ring by introducing that node listening on port
|
@irvingpop Makes sense... Rust's network code will pick a port for you if you specify |
I don't know if it should really be habitat's job to figure out which port to use. It seems more like an infrastructure constraint, and thus should be configured from outside habitat explicitly I think. I figure that if you'd deploy two different containers with webservers in them, they might both use port 80, and it would be on the ops part to map/use something to configure another port for example, shouldn't it? |
I feel a little bit uncomfortable about automating port selection by default. I would be much more comfortable having this turned on with a flag. I'm reminded of this RFC I opened: #1939 - is the core problem we are trying to solve automatic bootstrapping of the initial ring? |
I would be okay with it being a flag, but I'm not okay with it being on by default. |
I think we're all in agreement that it would be a totally reasonable feature to have so long as it's implemented appropriately (e.g. behind some kind of toggle or flag). For now we're going to sort this into help wanted. If anyone with an interest in implementing this is ready to get started hacking feel free to reach out for some implementation guidance from the core team! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you. |
This issue has been automatically closed after being stale for 400 days. We still value your input and contribution. Please re-open the issue if desired and leave a comment with details. |
As an operator of Habitized applications, I may want to use a networking mode like ECS Host-mode networking.
Since all ports are mapped to the host port, it means that my 2nd supervisor won't be able to successfully start - because ports 9631 and 9638 are already taken.
In these cases, it would be idea for the supervisor to automatically attempt to find an available port - hunting through an available range of ports. Chef-Zero used to have this same problem and was solved by chef/chef-zero#67
The text was updated successfully, but these errors were encountered: