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
When starting Consul as a windows service, it terminates immediately #6661
Comments
Your command is incorrect. You should place "=" after "-config-dir" flag |
@spawluk That doesn't seem to resolve the issue. I used: sc.exe create "Consul" binPath= "C:\Users\tguichin\ConsulSetup\Consul\consul.exe agent -config-dir=C:\Users\tguichin\ConsulSetup\Consul\consul.d\consul_config.json" start= auto and this is what I get when running in console. |
It looks like confuration error. Did you tried to run this command manually - not using windows service sc.exe? |
@spawluk Okay. So I tried it manually and it requires a bind due to multiple IP addresses. It also requires -data-dir parameter. As for "no known consul servers" error, does the -server parameter have to be given in order to be able to run consul? |
@spawluk I just looked back at the docs for "Running consul as a windows service" from the consul website and it seems the documentation is wrong. https://learn.hashicorp.com/consul/datacenter-deploy/windows This is what they use as console command to make a service, but it doesn't work. sc.exe create "Consul" binPath= "path to the Consul.exe agent-config-dir path to configuration directory" start= auto No '=' after '-config-dir' and no space in between 'agent' and '-config-dir' although I don't know if that would even be an issue. |
Personally I use consul with https://github.com/kohsuke/winsw wrapper. Command I use is Consul is run in one of 2 modes: client or server. To be able to run consul you have to have at least one server role consul. As documentation say server consul role is able to act as client, so you can use it as 127.0.0.1 DNS server on Eth interface. But to do that you have to change DNS port from defualt 8600 to 53. Then it requires Admin rights to run application due to MS ports below 1024 security policy. |
@spawluk thank you for your help. I'll have to do some more reading to better learn what each parameter is used for. Hopefully someone can update the docs on consul.io because, as they are right now, you can't run consul as a service. |
@xBentu Thanks for bringing this to our attention. I'll correct the docs to reflect the proper command syntax. |
@blake no problem. Thank you for the quick reply! |
I posted on an older issue hoping that I wouldn't have to make a new one, but didn't get an answer so I am making a new issue and linking to my comment. Any help is appreciated, and let me know if you need additional information.
#5623 (comment)
The text was updated successfully, but these errors were encountered: