-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Autoregister Nomad servers and clients as a service into Consul #510
Comments
@poll0rz Can you give us some use cases of registering the Nomad Clients with Consul please? The clients currently doesn't have any API and they are constantly sending heart beats to the Nomad servers, so using Consul checks or making them discoverable over the network for other applications probably doesn't add a lot of value. |
Sure, here is an example: What do you think? Or maybe this could be done just with Nomad already? |
I'm wondering as well what is the proposed action to re-run the clients when they fail. |
Your init system should restart Nomad in these cases. I think it makes sense to be able to use Consul to keep an eye on things, though. |
hi @cbednarski what do you mean with "your init system should restart Nomad in these cases"? you mean Nomad clients should be started with http://supervisord.org/ or similar? Yes I think it's a good idea that Nomad clients & servers register themselves in Consul, since we're going Hashicorp's full stack and we should know what's happening not only with our services, but with our distributed service scheduler as well, right? I hope you agree with that and make it possible heheh. I'm willing to contribute to the project too, but I'm just a Go rookie for now. |
Right. The OS's init system like upstart, systemd, or net start should handle this. The consul registration / health checking issue is an open question, though. We'll update here when we have more info. |
@adrianlop I have a potential workaround for you. I am not sure what systems you are using, but if you are using an OS that utilizes systemd you can use an A basic config (if your using systemd):
If you are not using systemd I am sure you can adapt the above to whatever init systems you are using. |
@supernomad thank you! I also had a workaround meanwhile. It consists on configuring Consul with a "nomad.json" that contains the service registry for Nomad, but your solution is elegant too ;) |
@adrianlop Thanks for the props. I was very tempted to do the config file as well when trying to figure this out, but I was worried that I would end up with incorrect service definitions or at the very least out of sync ones. How did you get around that, or is it just not an issue? |
@supernomad using config files for services and checks is safe. works great in static infrastructure if you have everything deployed with a CM (ansible, puppet..). btw, I think it'd be good if you add |
This has landed in master via #1167 |
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues. |
Hi,
Is this feature in the Nomad-Consul roadmap? I think it would be nice to have this.
Thank you!
The text was updated successfully, but these errors were encountered: